我想交叉编译PowerPC架构的Boost库(线程,系统)。我遵循下面的步骤,但面临问题。PowerPC架构的交叉编译Boost库
我运行一个shell脚本来设置我的工具链。编译器ppc_4xx-g ++在shell中可见。
步骤如下:
- 添加行 “用gcc:功率:ppc_4xx-G ++;”到文件user-config.jam
- 在根目录下运行./bootstrap.sh --prefix = BoostPowerPC。
- 运行./b2安装--build-DIR = BoostPowerPC工具包= GCC-功率--with线程--with系统级
结果:所有的目录被创建,但编译失败。我无法附上错误日志(请将您的电子邮件发送给我,以便我可以根据需要向您发送错误日志)。以下是错误日志的快照。
Component configuration:
- atomic : not building
- chrono : not building
- context : not building
- date_time : not building
- exception : not building
- filesystem : not building
- graph : not building
- graph_parallel : not building
- iostreams : not building
- locale : not building
- math : not building
- mpi : not building
- program_options : not building
- python : not building
- random : not building
- regex : not building
- serialization : not building
- signals : not building
- system : building
- test : not building
- thread : building
- timer : not building
- wave : not building
...patience...
...found 20376 targets...
...updating 10110 targets...
common.mkdir BoostPowerPC
common.mkdir BoostPowerPC/lib
common.mkdir BoostPowerPC/boost
common.mkdir BoostPowerPC/boost/bin.v2
common.mkdir BoostPowerPC/boost/bin.v2/libs
common.mkdir BoostPowerPC/boost/bin.v2/libs/system
common.mkdir BoostPowerPC/boost/bin.v2/libs/system/build
common.mkdir BoostPowerPC/boost/bin.v2/libs/system/build/gcc-power
common.mkdir BoostPowerPC/boost/bin.v2/libs/system/build/gcc-power/release
common.mkdir BoostPowerPC/boost/bin.v2/libs/system/build/gcc-power/release/threading-multi
gcc.compile.c++ BoostPowerPC/boost/bin.v2/libs/system/build/gcc-power/release/threading-multi/error_code.o
In file included from ./boost/config/select_stdlib_config.hpp:18,
from ./boost/config.hpp:40,
from ./boost/system/config.hpp:13,
from libs/system/src/error_code.cpp:18:
/opt/ELDK/4.2/ppc_4xx/usr/include/c++/4.2.2/cstddef:50:28: error: bits/c++config.h: No such file or directory
In file included from /opt/ELDK/4.2/ppc_4xx/usr/include/c++/4.2.2/ios:43,
from /opt/ELDK/4.2/ppc_4xx/usr/include/c++/4.2.2/ostream:45,
from /opt/ELDK/4.2/ppc_4xx/usr/include/c++/4.2.2/iterator:70,
from ./boost/iterator.hpp:17,
from ./boost/operators.hpp:86,
from ./boost/system/error_code.hpp:17,
from libs/system/src/error_code.cpp:19:
.
.
.
它抱怨找不到文件C++ config.h。但该文件存在于/opt/ELDK/4.2/usr/include/c++/4.2.2/powerpc-linux/bits目录中
然后我尝试在b2命令中使用标记“include”。但是后来我得到一个错误,即文件cstddef没有找到,它出现在目录/opt/ELDK/4.2/usr/include/c++/4.2.2中。我认为我已经写完了包含路径。
您认为是什么问题?为什么我的编译器找不到该文件,即使它存在?有什么建议么 ?
更新:
我用-d + 2和-q选项和下面是结果。
"ppc_4xx-g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pedantic -pthread -fPIC -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_DYN_LINK=1 -DNDEBUG -I"." -I"/opt/ELDK/4.2/ppc_4xx/usr/include" -c -o "BoostPowerPC/boost/bin.v2/libs/system/build/gcc-power/release/threading-multi/error_code.o" "libs/system/src/error_code.cpp"
编译日志:
In file included from ./boost/config/select_stdlib_config.hpp:18,
from ./boost/config.hpp:40,
from ./boost/system/config.hpp:13,
from libs/system/src/error_code.cpp:18:
/opt/ELDK/4.2/ppc_4xx/usr/include/c++/4.2.2/cstddef:50:28: error: bits/c++config.h: No such file or directory
正如我们可以看到包括在内,可见的编译器,具有所需的文件更高的目录。我甚至尝试使用-L命令并指定根目录。它仍然没有帮助。
我检查的ppc_4xx-g ++以及2个选项编译选项我感兴趣
--sysroot =:这是所有包含和由编译器使用的库的根目录。
-B:使用这个我们可以为编译器添加一个搜索路径。
我试过了,它没有帮助。有什么建议么 ?
你有指向有问题的错误的指针吗? – 2013-02-23 11:51:51
@VladimirPrus:我没有指向错误的指针,但是我从这个[post]中找到了解决方案(http://stackoverflow.com/questions/4643197/missing-include-bits-cconfig-h-when-交叉编译-64位程序-32位) – Neo 2013-02-23 19:41:00
谢谢。看起来像Ubuntu特定的错误。 – 2013-02-24 05:33:33