未定义引用“curl_free”错误。找不到该做什么

未定义引用“curl_free”错误。找不到该做什么

我一直在尝试安装打开n0w,但是当我运行 make 时出现错误。

../../libsn0wcore/libsn0wcore.so: undefined reference to `curl_free'
../../libsn0wcore/libsn0wcore.so: undefined reference to `libusb_open'
../../libsn0wcore/libsn0wcore.so: undefined reference to `curl_global_cleanup'
../../libsn0wcore/libsn0wcore.so: undefined reference to `curl_easy_getinfo'
../../libsn0wcore/libsn0wcore.so: undefined reference to `curl_easy_perform'
../../libsn0wcore/libsn0wcore.so: undefined reference to `curl_easy_unescape'
../../libsn0wcore/libsn0wcore.so: undefined reference to `libusb_set_interface_alt_setting'
../../libsn0wcore/libsn0wcore.so: undefined reference to `AES_set_encrypt_key'
../../libsn0wcore/libsn0wcore.so: undefined reference to `libusb_release_interface'
../../libsn0wcore/libsn0wcore.so: undefined reference to `libusb_close'
../../libsn0wcore/libsn0wcore.so: undefined reference to `libusb_get_string_descriptor_ascii'
../../libsn0wcore/libsn0wcore.so: undefined reference to `libusb_get_configuration'
../../libsn0wcore/libsn0wcore.so: undefined reference to `libusb_clear_halt'
../../libsn0wcore/libsn0wcore.so: undefined reference to `AES_cbc_encrypt'
../../libsn0wcore/libsn0wcore.so: undefined reference to `libusb_get_device_list'
../../libsn0wcore/libsn0wcore.so: undefined reference to `libusb_bulk_transfer'
../../libsn0wcore/libsn0wcore.so: undefined reference to `SHA1_Update'
../../libsn0wcore/libsn0wcore.so: undefined reference to `curl_easy_init'
../../libsn0wcore/libsn0wcore.so: undefined reference to `AES_set_decrypt_key'
../../libsn0wcore/libsn0wcore.so: undefined reference to `libusb_set_configuration'
../../libsn0wcore/libsn0wcore.so: undefined reference to `libusb_reset_device'
../../libsn0wcore/libsn0wcore.so: undefined reference to `SHA1_Init'
../../libsn0wcore/libsn0wcore.so: undefined reference to `libusb_exit'
../../libsn0wcore/libsn0wcore.so: undefined reference to `libusb_init'
../../libsn0wcore/libsn0wcore.so: undefined reference to `libusb_get_device_descriptor'
../../libsn0wcore/libsn0wcore.so: undefined reference to `libusb_free_device_list'
../../libsn0wcore/libsn0wcore.so: undefined reference to `libusb_claim_interface'
../../libsn0wcore/libsn0wcore.so: undefined reference to `libusb_control_transfer'
../../libsn0wcore/libsn0wcore.so: undefined reference to `curl_easy_setopt'
../../libsn0wcore/libsn0wcore.so: undefined reference to `curl_easy_cleanup'
../../libsn0wcore/libsn0wcore.so: undefined reference to `SHA1_Final'
collect2: error: ld returned 1 exit status
Failed to link opensn0w_cli!
make[5]: *** [opensn0w_cli] Error 1
make[4]: *** [all] Error 2
make[3]: *** [subdirs] Error 2
make[2]: *** [all] Error 2
make[1]: *** [subdirs] Error 2
make: *** [all] Error 2

我在任何地方都找不到解决方案。我找到了说要添加 -lcurl 的答案,所以我尝试了,make -lcurl但这不起作用。知道如何解决这个问题吗?

我正在使用 Linux Mint 17.3。我运行后apt-get install libcurl4-openssl-dev显示已安装到最新版本。

./配置输出:

checking for gcc... gcc
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 gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
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 minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for library containing strerror... none required
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether ln -s works... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for rm... /bin/rm
checking for mv... /bin/mv
checking for cp... /bin/cp
checking for ln... /bin/ln
checking for tar... /bin/tar
checking for ar... /usr/bin/ar
checking for ranlib... /usr/bin/ranlib
checking for xargs... /usr/bin/xargs
checking for find... /usr/bin/find
checking for uname... /bin/uname
checking for inline... inline
checking whether byte ordering is bigendian... no
checking whether make sets $(MAKE)... yes
checking how to generate dependency info... assuming gcc -MM
checking for link.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for tput... /usr/bin/tput
checking for shared library system... GNU
checking whether we need an implib... no
checking for strftime... yes
checking for strdup... yes
checking for inet_pton... yes
checking for inet_ntop... yes
checking for gettimeofday... yes
checking for umask... yes
checking for mmap... yes
checking for arc4random... no
checking for getrlimit... yes
checking for fork... yes
checking for getpid... yes
checking for execve... yes
checking for socket... yes
checking for gethostbyname... yes
checking for inflate... no
checking for inflate in -lz... yes
checking for dlsym in -ldl... yes
checking for dlsym in -lelf... no
checking for pthread_join in -lpthread... yes
checking for libusb_init in -lusb-1.0... no
checking for readline in -lreadline... no
checking for curl_free in -lcurl... yes
checking for curl_free in -lcurldll... no
checking for SHA1_Init in -lcrypto... yes
checking for SHA1_Init in -lssl... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for an ANSI C-conforming const... yes
checking for uid_t in sys/types.h... yes
checking for inline... (cached) inline
checking whether byte ordering is bigendian... (cached) no
checking for int16_t... yes
checking for int32_t... yes
checking for int8_t... yes
checking for mode_t... yes
checking for off_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for ssize_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uint8_t... yes
checking for working volatile... yes
checking for gcc option to accept ISO C99... -std=gnu99
checking if you want to use absolute paths when building... #
checking if you want FHS-like pathnames... no
checking GCC flag(s) -std=gnu99... ok
checking GCC flag(s) -Werror-implicit-function-declaration... ok
checking if we should compile contrib modules... no
no
configure: touching .deps files
configure: creating ./config.status
config.status: creating buildsys.mk
config.status: creating extra.mk
config.status: creating include/config.h
config.status: include/config.h is unchanged

Configuration:
    opensn0w version     : 2.0.0
    Installation prefix  : /usr/local/opensn0w
    Module root directory: /usr/local/opensn0w
    Config directory     : ${prefix}/etc
    Contrib modules      : no
    Stacktrace           : no
    CFLAGS               : -g -O2

Type make to build opensn0w, and make install to install it.

答案1

您必须提供 -lcurl 来链接二进制文件。您的 make 命令行参数化了 make 命令,而不是链接子命令。

您必须检查构建脚本。检查源代码,我们可以看到使用 gnu autoconf 的旧源代码。使用

LDFLAGS=-lcurl

./configure 前缀可以在配置阶段生成更正确的 makefile。

请注意,您的错误消息不仅表明 libcurl,而且还缺少其他库(libusb、某些加密库等)。

注意#2:在大多数情况下,此类问题不是由链接器标志引起的,而是由系统上没有所需的开发包引起的。这就是 ./configure 完全禁用 curl 的原因。在这种情况下,请安装它们。在 Debian 上,可以通过

apt-get install libcurl-dev

命令。然后重新运行配置。

Note#3:说出您的发行版并复制粘贴整个 ./configure 输出,这将使我能够将这个答案扩展为一个易于理解的答案。

解决办法不是减少盐的摄入量,而是增加水的摄入量。如果您的肾脏工作良好,您可以相信它们会选择您的身体想要的东西。如果不是,请按照医生的指示进行。

相关内容