Problem "linking" external library to freeradius module

kky mingyur at
Sat Sep 30 19:23:52 CEST 2006

Hi, i need to use the libgcrypt ( witch i have installed in
/usr/local/lib  for my auth module, usually i just #include <gcrypt.h>
and in my Makefile just append a few flags:
" -I/usr/local/include -L/usr/local/lib -lgcrypt -L/usr/local/lib
-lgpg-error "
so i put this line in my makefile (witch I copied from another eap auth
module! ):

    TARGET      = rlm_eap_xxx
    SRCS        = rlm_eap_xxx.c eap_xxx.c crypto_xxx.c
    RLM_CFLAGS  = $(INCLTDL) -I../.. -I../../libeap \
    -I/usr/local/include -I/usr/local/lib -I/usr/include \
    -L/tmp/freeradius-$(VERS)/src/lib \
    -L/usr/local/lib -lgcrypt -L/usr/local/lib -lgpg-error
    HEADERS     = eap_xxx.h crypto_xxx.h ../../eap.h ../../rlm_eap.h


    include ${RLM_DIR}../rules.mak

    $(LT_OBJS): $(HEADERS)

i start freeradiusd -X and when my code calls a libgcrypt function it
says :
radiusd: symbol lookup error: /usr/local/lib/
undefined symbol: gcry_mpi_powm

additionally in the libgrcrypt documentation is telling that if i'm
using automake (witch i don't handle at all !!)
i can use the defined Autoconf variables  in my `' :


LIBGCRYPT_CFLAGS needed for compilation of the program to find the
`gcrypt.h' header file, and LIBGCRYPT_LIBS needed to link the program to
the Libgcrypt library.

I've tried to put them in a few places but without results ! do you have
an advice ?!

More information about the Freeradius-Devel mailing list