2012-03-06 143 views
0

我需要你对这个问题的帮助,如果任何人有信息。链接错误:未定义的引用静态libarary

我已经为xscale-elf(ARM架构)配置了speex1.2rc1,然后执行了makemake install。所以,我在/usr/local/lib中获得了libspeex.alibogg.a也被编译了。但我当我的图书馆链接到我的节目(加入LDFLAGS += -lspeex -lm),并尝试编译,我得到这个错误:

/usr/lib/gcc/xscale-elf/3.4.3/../../../../xscale-elf/bin/ld: cannot find -lspeex 
collect2: ld returned 1 exit status 
make: *** [exe0] Error 1 

我通过./configure选项:

./configure --host=xscale-elf 

这很可能是链接器无法看到libspeex.a,我也试过行LDFLAGS += /usr/local/lib/libspeex.a -lm Makefile中却得到了另一个错误(也连接):

/tmp/ccvi7Pns.o(.text+0x179c): In function `main': 
: undefined reference to `BlinkC$speex_bits_init' 
collect2: ld returned 1 exit status 
make: *** [exe0] Error 1 

回答

0
./configure --host=xscale-elf 

你没有告诉你什么主机你正在编译它,但给你的路径ld,似乎你是交叉编译。如果是这样,你的主机很可能不是xscale-elf(但可能i686-linux-gnu或一些这样的)。

您需要了解主机目标之间的差异,并重建speex1使用适当的编译器和--target=xscale-elf(无论是)。

此外,用于taget安装库到/usr/local/lib错误的事情。

相关问题