Problem "linking" external library to freeradius module
Hi, i need to use the libgcrypt (gnupg.org) 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 RLM_INSTALL = RLM_DIR=../../ 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/rlm_eap_xxx-1.1.3.so: 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 `Makefile.am' : AM_CPPFLAGS = $(LIBGCRYPT_CFLAGS) LDADD = $(LIBGCRYPT_LIBS) 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 ?! THANK YOU !! kky
kky <mingyur@inventati.org> wrote:
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
See the rest of the Makefiles for rlm_eap_*. They put the '-L' and '-l' options into RLM_LIBS, not RLM_CFLAGS. Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog
participants (2)
-
Alan DeKok -
kky