Building modules in C++ modules
Is it possible to build modules in C++ (g++ compiler)? I have taken the rlm_example.c file, renamed as cpp and then run make and I see some errors reported in the libradius header files. Before I spend time trying to figure out what the errors are, just wanted to make sure that this has been done before. Here are the errors reported in any case... g++ -g -O2 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall -D_GNU_SOURCE -DNDEBUG -DIE_LIBTOOL_DIE -I/home/marcose/Downloads/freeradius-server-2.1.8/src -I/usr/include -c rlm_grid.cpp -fPIC -DPIC -o .libs/rlm_grid.o In file included from /home/marcose/Downloads/freeradius-server-2.1.8/src/freeradius-devel/radiusd.h:30, from rlm_grid.cpp:27: /home/marcose/Downloads/freeradius-server-2.1.8/src/freeradius-devel/libradius.h:160: error: expected type-specifier before ';' token /home/marcose/Downloads/freeradius-server-2.1.8/src/freeradius-devel/libradius.h:339: error: expected ')' before 'operator' /home/marcose/Downloads/freeradius-server-2.1.8/src/freeradius-devel/libradius.h:339: error: expected initializer before 'operator' In file included from /home/marcose/Downloads/freeradius-server-2.1.8/src/freeradius-devel/radiusd.h:33, from rlm_grid.cpp:27: /home/marcose/Downloads/freeradius-server-2.1.8/src/freeradius-devel/conffile.h:94: error: expected ',' or '...' before 'template' In file included from rlm_grid.cpp:27: /home/marcose/Downloads/freeradius-server-2.1.8/src/freeradius-devel/radiusd.h:246: error: declaration of 'home_server* auth_req::home_server' /home/marcose/Downloads/freeradius-server-2.1.8/src/freeradius-devel/realms.h:88: error: changes meaning of 'home_server' from 'typedef struct home_server home_server' /home/marcose/Downloads/freeradius-server-2.1.8/src/freeradius-devel/radiusd.h:582: error: expected ')' before 'operator' /home/marcose/Downloads/freeradius-server-2.1.8/src/freeradius-devel/radiusd.h:582: error: expected initializer before 'operator' rlm_grid.cpp: In function 'int grid_instantiate(CONF_SECTION*, void**)': rlm_grid.cpp:76: error: invalid conversion from 'void*' to 'rlm_grid_t*' rlm_grid.cpp: In function 'int grid_authorize(void*, REQUEST*)': rlm_grid.cpp:108: error: 'pairmake' was not declared in this scope make: *** [rlm_grid.lo] Error 1
Exception handling for one. Also, if one would like to use third party C++ libraries. On Mar 17, 2010, at 4:49 PM, Alan DeKok <aland@deployingradius.com> wrote:
Abu Marcose wrote:
Is it possible to build modules in C++ (g++ compiler)?
No.
I have taken the rlm_example.c file, renamed as cpp and then run make and I see some errors reported in the libradius header files.
I don't see why it's useful to use C++.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Abu Marcose wrote:
Exception handling for one.
<shrug> C programming doesn't require that.
Also, if one would like to use third party C++ libraries.
C and C++ generally aren't compatible. You have access to git. You can edit the headers && code to make them compatible with C++. Then, submit the patches back, or maintain a branch yourself. Git makes this trivial. Alan DeKok.
participants (2)
-
Abu Marcose -
Alan DeKok