我试图为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源link,在解压之后我去了代码所在的目录并执行{{1 }}
最后通过
安装库./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
在这篇文章的开头我仍然得到同样的错误......我做错了什么?
提前致谢
EDIT2:
我想我现在的问题是,libdeamon并没有被交叉编译,我无法理解为什么,在交叉编译库libdeamon之后我已经检查过库是不是交叉编译为arm,它&& #39; s仍然是为了构建一个可以看到的英特尔
./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
如果我尝试用#34;交叉编译&#34;编译主项目。库我得到了这个
:~/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
那我该怎么办?