我试图编译libircclient启用SSL未定义的参考`dlopen的”使用SSL建立libircclient启用时
export LDFLAGS="-Wl,--no-as-needed -ldl -L/usr/local/ssl/lib -lssl -lcrypto"
export CPATH=/usr/local/include
export LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH=/usr/local/lib
./configure --enable-openssl --enable-ipv6
但我得到的错误
undefined reference to `dlopen'
这是我的构建日志
[email protected]:~/luaTest/thirdparty/libircclient-1.8$ export LDFLAGS="-ldl -L/usr/local/ssl/lib -lssl -lcrypto"
[email protected]:~/luaTest/thirdparty/libircclient-1.8$ export CPATH=/usr/local/[email protected]:~/luaTest/thirdparty/libircclient-1.8$ export LIBRARY_PATH=/usr/local/lib
[email protected]:~/luaTest/thirdparty/libircclient-1.8$ export LD_LIBRARY_PATH=/usr/local/lib
[email protected]:~/luaTest/thirdparty/libircclient-1.8$ ./configure --enable-openssl --enable-ipv6
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for ar... ar
checking for ranlib... ranlib
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking whether lstat correctly handles trailing slash... yes
checking whether stat accepts an empty string... no
checking for localtime_r... yes
checking for socket... yes
checking for socket in -lsocket... no
checking for getaddrinfo... yes
checking for inet_pton... yes
checking for getaddrinfo in -lnsl... yes
checking For MinGW32... no
checking for CRYPTO_new_ex_data in -lcrypto... no
configure: error: OpenSSL not found
[email protected]:~/luaTest/thirdparty/libircclient-1.8$ make
for subdir in src examples; do \
make -C $subdir || exit 1; \
done
make[1]: Entering directory `/home/user/luaTest/thirdparty/libircclient-1.8/src'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/user/luaTest/thirdparty/libircclient-1.8/src'
make[1]: Entering directory `/home/user/luaTest/thirdparty/libircclient-1.8/examples'
gcc -o spammer spammer.o -L../src/ -lircclient -lpthread -lssl -lcrypto -lnsl
/usr/local/lib/../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x15): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x2b): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x35): undefined reference to `dlclose'
/usr/local/lib/../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
dso_dlfcn.c:(.text+0x33b): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x410): undefined reference to `dlerror'
/usr/local/lib/../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
dso_dlfcn.c:(.text+0x48b): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x566): undefined reference to `dlerror'
/usr/local/lib/../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
dso_dlfcn.c:(.text+0x5e0): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x658): undefined reference to `dlclose'
dso_dlfcn.c:(.text+0x69d): undefined reference to `dlerror'
/usr/local/lib/../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':
dso_dlfcn.c:(.text+0x736): undefined reference to `dladdr'
dso_dlfcn.c:(.text+0x821): undefined reference to `dlerror'
/usr/local/lib/../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload':
dso_dlfcn.c:(.text+0x87e): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
make[1]: *** [spammer] Error 1
make[1]: Leaving directory `/home/user/luaTest/thirdparty/libircclient-1.8/examples'
make: *** [all] Error 1
[email protected]:~/luaTest/thirdparty/libircclient-1.8$
如果我在配置后设置标志,我得到相同的错误,问题依然存在 – Chris
我明白。现在,您是否按照我的建议查看了Makefile,看看它是如何生成链接命令的? –
我从make文件中删除了examples目录,它只是说没有为make文件指定目标并停止 – Chris