Search code examples
gccmakefileldconfigurelibtool

Link error with libtool gcc and ld


I have the following configure+make script to build some sw package (libosip):

rm -rf build
rm -rf libosip2-4.1.0
rm -rf libosip2-4.1.0.tar.gz

wget https://ftp.gnu.org/gnu/osip/libosip2-4.1.0.tar.gz
tar xf libosip2-4.1.0.tar.gz

mkdir build
cd build
../libosip2-4.1.0/configure --enable-test --disable-shared
make -j

Then I add a call from libosip main function to klee_make_symbolic. klee_make_symbolic is inside a library in this path:

/home/oren/GIT/LatestKlee/klee/build/lib/

So I tried adding an LDFLAGS before calling make:

LDFLAGS="-L/home/oren/GIT/LatestKlee/klee/build/lib/" make -j

But I get the following error:

/bin/bash ../../libtool --tag=CC   --mode=link gcc -g   -pedantic -g -DENABLE_TRACE -g    -o torture_test torture.o   ../../src/osipparser2/libosipparser2.la  
libtool: link: gcc -g -pedantic -g -DENABLE_TRACE -g -o torture_test torture.o  ../../src/osipparser2/.libs/libosipparser2.a
torture.o: In function `read_text':
/home/oren/GIT/LatestKlee/myBenchmarks/libosip/build/src/test/../../../libosip2-4.1.0/src/test/torture.c:62: undefined reference to `klee_make_symbolic'
collect2: error: ld returned 1 exit status

Any help is very much appreciated, thanks!


Solution

  • You need to actually link that library with -l linker option.

    LDFLAGS="-L/home/oren/GIT/LatestKlee/klee/build/lib/" adds a library search path but does not link any library.