ld在构建上下文中找不到现有的库

时间:2016-08-02 14:57:54

标签: gcc ld libtool

我的构建失败,缺少一个库列表:

/usr/bin/ld: cannot find -lusb-1.0
/usr/bin/ld: cannot find -lusb
/usr/bin/ld: cannot find -lftdi1
/usr/bin/ld: cannot find -lreadline
/usr/bin/ld: cannot find -lncurses

但是,当我运行

时,对于每个这些库
  

ld -llib --verbose

我可以看到该库已找到。例如:

  

ld -lftdi1 --verbose

[...]
attempt to open /usr/x86_64-pc-linux-gnu/lib64/libftdi1.so failed
attempt to open /usr/x86_64-pc-linux-gnu/lib64/libftdi1.a failed
attempt to open /usr/lib/libftdi1.so succeeded
-lftdi1 (/usr/lib/libftdi1.so)
libusb-1.0.so.0 needed by /usr/lib/libftdi1.so
found libusb-1.0.so.0 at /usr/lib/libusb-1.0.so.0
libc.so.6 needed by /usr/lib/libftdi1.so
found libc.so.6 at /usr/lib/libc.so.6
libudev.so.1 needed by /usr/lib/libusb-1.0.so.0
found libudev.so.1 at /usr/lib/libudev.so.1
libpthread.so.0 needed by /usr/lib/libusb-1.0.so.0
found libpthread.so.0 at /usr/lib/libpthread.so.0
ld-linux-x86-64.so.2 needed by /usr/lib/libc.so.6
found ld-linux-x86-64.so.2 at /usr/lib/ld-linux-x86-64.so.2
libcap.so.2 needed by /usr/lib/libudev.so.1
found libcap.so.2 at /usr/lib/libcap.so.2
librt.so.1 needed by /usr/lib/libudev.so.1
found librt.so.1 at /usr/lib/librt.so.1
libm.so.6 needed by /usr/lib/libudev.so.1
found libm.so.6 at /usr/lib/libm.so.6
libresolv.so.2 needed by /usr/lib/libudev.so.1
found libresolv.so.2 at /usr/lib/libresolv.so.2
ld: warning: cannot find entry symbol _start; not setting start address

失败的构建线就是这个:

/bin/sh ./libtool  --tag=CC   --mode=link gcc -Wall -Wno-pointer-sign -g -O2 --static   -o myprog myprog-main.o myprog-term.o ./libmyprog.a -lusb-1.0 -lusb -lftdi1   -lelf -lpthread -lm -lreadline -lncurses

失败的原因可能是什么?

0 个答案:

没有答案