我想要Boost的靜態通用二進制庫。 (最好是最新的穩定版本,也就是1.43.0或更新版本。)將Boost編譯爲靜態通用二進制庫
我發現了很多類似的問題和可能的解決方案。但是,他們大多數似乎過時了。也沒有人真的有效。
現在,我想
sudo ./bjam --toolset=darwin --link=static --threading=multi \
--architecture=combined --address-model=32_64 \
--macosx-version=10.4 --macosx-version-min=10.4 \
install
,編譯和安裝罰款。但是,生成的二進制文件似乎已破解。
[email protected] 47 (openlierox) %file /usr/local/lib/libboost_signals.a
/usr/local/lib/libboost_signals.a: current ar archive random library
[email protected] 49 (openlierox) %lipo -info /usr/local/lib/libboost_signals.a
input file /usr/local/lib/libboost_signals.a is not a fat file
Non-fat file: /usr/local/lib/libboost_signals.a is architecture: x86_64
編輯:看起來命令是錯誤的,我必須刪除大多數選項的「 - 」。所以,我現在想的命令(-a只是意味着重建所有):
sudo ./bjam -a toolset=darwin link=static threading=multi \
architecture=combined address-model=32_64 \
macosx-version=10.4 macosx-version-min=10.4 \
install
然而,這給了許多奇怪的錯誤(我已經早些時候曾),所有這樣的:
darwin.compile.c++.pch bin.v2/libs/math/build/darwin-4.2.1/release/address-model-32_64/architecture-combined/link-static/macosx-version-min-10.4/macosx-version-10.4/threading-multi/../src/tr1/pch.hpp.gch
In file included from ./boost/math/special_functions/acosh.hpp:18,
from ./boost/math/special_functions.hpp:15,
from libs/math/build/../src/tr1/pch.hpp:9:
./boost/config/no_tr1/cmath.hpp:21:19: error: cmath: No such file or directory
這可能是我在構建通用二進制文件時遇到的另一個問題:g++ on MacOSX doesn't work with -arch ppc64
看到我的答案。使它與GCC 4.2一起工作的修復很容易。並且工作得很好。但是,無論如何感謝您的信息,這在稍後的時間對我來說可能仍然有用。 – Albert 2010-05-14 00:56:05
這個答案比在SDK上黑客更好。 – paleozogt 2011-02-21 17:41:01