我想交叉編譯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