Linking Shared/Static library in Freeradius Module

Resit Sahin resitsahin at
Tue Dec 6 15:43:08 CET 2011


I am writing a FreeRadius (Version 2) module for version Freeradius 2.1.10
. The module works fine. When i want to link a shared/static library from
the Makefile of the module i get errors.

I link to a static library and i run radius server with the module (
radiusd -X) then i get the error:

/usr/local/etc/raddb/radiusd.conf[665]: Failed to link to module
'rlm_itap': file not found

makefile of the freeradius module :

*VERS = 2.1.10
CFLAGS  =  -DNDEBUG -Wall -I/usr/include \
LIBS    =  -lc -L. icc-wrapper.a
ALL:    rlm_itap.o rlm_itap-$(VERS).so*

rlm_itap is the name of my module. When i remove *icc-wrapper.a ,
everything works fine.

*For the shared library case. Everything works fine until the function from
the shared library is called inside the module. I got the error:

/libexec/ /usr/local/lib/freeradius-2.1.10/
Undefined symbol "sendiccmsg"

in that case. sendiccmsg is the only function i have in my shared library.

The makefile of the freeradius module:

VERS = 2.1.10

CFLAGS  =  -DNDEBUG -Wall -I/usr/include \

LIBS    =  -lc

ALL:    rlm_itap.o rlm_itap-$(VERS).so

rlm_itap.o:    rlm_itap.c
    cc -g -fPIC -DPIC -c $(CFLAGS) rlm_itap.c

rlm_itap-$(VERS).so:    rlm_itap.o
    cc -g -shared -Wl,-soname,rlm_itap-$(VERS).so \
           -o rlm_itap-$(VERS).so rlm_itap.o $(LIBS)

install:        ALL
    install rlm_itap-$(VERS).so /usr/local/lib/freeradius-$(VERS)
    ln -fs rlm_itap-$(VERS).so /usr/local/lib/freeradius-$(VERS)/

    rm rlm_itap*.o rlm_itap*.so

The static/shred library i am using is compiled as a C++ library with
extern "C" in front of function definitions.

Resit Sahin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Freeradius-Users mailing list