我正在尝试为 arm-mv5sft-linux-gnueabi 处理器交叉编译一些 C++ 项目,我已按以下方式设置了该项目的 ./configure:
./configure --build=i686-linux --host=arm-mv5sft-linux-gnueabi --target=arm-mv5sft-linux-gnueabi CC=~/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-gcc CXX=~/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-g++ LD=~/s/arm-mv5sft-linux-gnueabi/SW3.2p1/arm-mv5sft-linux-gnueabi/bin/arm-mv5sft-linux-gnueabi-ld LDFLAGS=-L/usr/include/libdaemon --with-sysroot=/home/thales/s/arm-mv5sft-linux-gnueabi/SW3.2p1/arm-mv5sft-linux-gnueabi --prefix=/justInstalled --disable-shared --enable-threads=posix --enable-long-long --enable-target-optspace --disable-nls --with-float=soft --disable-multilib --enable-symvers=gn
配置成功,但是当我做时出现包含错误
libtool: link: warning: library `/home/j/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/../lib/gcc/arm-mv5sft-linux-gnueabi/4.3.2/../../../../arm-mv5sft-linux-gnueabi/lib/libstdc++.la' was moved.
CXX Main.o
Main.cpp:28:30: error: libdaemon/daemon.h: No such file or directory
Main.cpp: In function 'int __daemon_run()':
Main.cpp:175: error: 'daemon_retval_send' was not declared in this scope
.
.
.
make[1]: Leaving directory `/home/j/ibrdtn-svn/daemon'
make: *** [all-recursive] Error 1
如果我去文件 Main.cpp 看看发生了什么,它抱怨 libdeamon 的包含
...
#include "config.h"
#include "Configuration.h"
#include <ibrcommon/Logger.h>
#include <ibrcommon/data/File.h>
#ifdef HAVE_LIBDAEMON
#include <libdaemon/daemon.h>
#endif
#include <string.h>
#include <csignal>
#include <set>
...
我已经检查了我已经安装了 libdeamon
@ubuntu:~$ pkg-config --libs libdaemon
-ldaemon
@ubuntu:~$locate libdaemon
/usr/include/libdaemon
/usr/include/libdaemon/daemon.h
/usr/include/libdaemon/dexec.h
/usr/include/libdaemon/dfork.h
/usr/include/libdaemon/dlog.h
/usr/include/libdaemon/dnonblock.h
/usr/include/libdaemon/dpid.h
/usr/include/libdaemon/dsignal.h
/usr/lib/libdaemon.a
/usr/lib/libdaemon.so
/usr/lib/libdaemon.so.0
/usr/lib/libdaemon.so.0.5.0
/usr/lib/pkgconfig/libdaemon.pc
为什么包含错误?我试图包括使用
./configure (as before) LDFLAGS=-llibdeamon (as before)
但是配置告诉我有一个错误,我必须阅读 conf.log,上面写着
/home/j/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/../lib/gcc/arm-mv5sft-linux-gnueabi/4.3.2/../../../../arm-mv5sft-linux-gnueabi/bin/ld: cannot find -llibdeamon
collect2: ld returned 1 exit status
任何想法将不胜感激!
提前致谢,
问候
编辑
我试图交叉编译 libdaemon 库但我无法实现,我已经下载了 libdaemon 源链接,解压后我转到代码所在的目录并执行 ./configure --build=i686-linux --host=arm-mv5sft-linux-gnueabi --target=arm-mv5sft-linux-gnueabi CC=~/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-gcc CXX=~/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-g++ LD=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/arm-mv5sft-linux-gnueabi/bin/arm-mv5sft-linux-gnueabi-ld --prefix=/usr
最后通过执行安装库
make install DESTDIR=/home/t/libdaemon-0.14
但是,当我像这样重新启动主项目的配置时
./configure --build=i686-linux --host=arm-mv5sft-linux-gnueabi --target=arm-mv5sft-linux-gnueabi CC=~/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-gcc CXX=~/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-g++ LD=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/arm-mv5sft-linux-gnueabi/bin/arm-mv5sft-linux-gnueabi-ld CCPFLAGS=-I/home/t/libdaemon-0.14/usr/include LDFLAGS=-L/home/t/libdaemon-0.14/lib --with-sysroot=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/arm-mv5sft-linux-gnueabi --prefix=/justInstalled --disable-shared --enable-threads=posix --enable-long-long --enable-target-optspace --disable-nls --with-float=soft --disable-multilib --enable-symvers=gnu
我在这篇文章的开头仍然遇到同样的错误......我做错了什么?
提前致谢
编辑2:
我想我现在的问题是,libdeamon 没有为 arm 交叉编译,我不明白为什么在交叉编译库 libdeamon 后我检查了该库没有为 arm 交叉编译,它仍然是为构建可以看到英特尔
:~/libdaemon-0.14$ file -F usr/*/*.*
usr/lib/libdaemon.lausr/lib/libdaemon.a libtool library file,
usr/lib/libdaemon.sousr/lib/libdaemon.a symbolic link to `libdaemon.so.0.5.0'
usr/lib/libdaemon.so.0usr/lib/libdaemon.a symbolic link to `libdaemon.so.0.5.0'
usr/lib/libdaemon.so.0.5.0usr/lib/libdaemon.a ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=0xe4959941fb153e1dec5ec84f798dc32928219ae2, not stripped
如果我尝试使用“交叉编译”库编译主项目,我会得到这个
libtool: link: warning: library `/home/j/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/../lib/gcc/arm-mv5sft-linux-gnueabi/4.3.2/../../../../arm-mv5sft-linux-gnueabi/lib/libstdc++.la' was moved.
/home/j/libdaemon-0.14/usr/lib/libdaemon.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[3]: *** [dtnd] Error 1
那我该怎么办??