I have an autotools-based library project that I recently tried to compile on Ubuntu 13.10. It's worked on past versions, but now when it tries to link my test harness, libtool is changing -lcurl to /usr/lib/x86_64-linux-gnu/libcurl.so. Why is it doing this? If I manually remove $(CURL_LIBS) from app_LDADD and replace with -lcurl, it links correctly.
Configure.ac:
PKG_CHECK_MODULES(CURL, libcurl >= 7.20)
tests/Makefile.am:
check_mylib_LDADD = ../lib/libmylib.la \
$(top_srcdir)/dep/childproj/lib/libchildprj.la $(CURL_LIBS) $(XML_LIBS) \
$(SSL_LIBS)
Output from make. Note how -lcurl gets expanded to the .so file.
/bin/bash ../libtool --tag=CC --mode=link gcc -I/usr/include/libxml2 \
-I../dep/childproj/lib -I./../lib -I../dep/childproj/lib -g -O2 \
-Wall -Werror -o check_mylib check_mylib-seatest.o check_mylib-test.o \
check_mylib-test_mylib.o check_mylib-test_xmlbind.o ../lib/libmylib.la \
../dep/childproj/lib/libchildproj.la -lcurl -lxml2 -lssl -lcrypto
libtool: link: gcc -I/usr/include/libxml2 -I../dep/childproj/lib \
-I./../lib -I../dep/childproj/lib -g -O2 -Wall -Werror -o .libs/check_mylib \
check_mylib-seatest.o check_mylib-test.o check_mylib-test_mylib.o \
check_mylib-test_xmlbind.o ../lib/.libs/libmylib.so \
../dep/childproj/lib/.libs/libchildproj.so \
/usr/lib/x86_64-linux-gnu/libcurl.so -lxml2 -lssl -lcrypto -pthread
../dep/childproj/lib/.libs/libchildproj.so: undefined reference to `curl_easy_perform'
<more undefined reference errors>
libchildproj.solinked? That seems to not be linked with-lcurl, but should be, according to the error. - ldav1s-lcurlseems to be stripped from the second output line and therefore not linked with it. - ldav1s