簡體   English   中英

使用MinGW 64安裝Boost-(Cygwin)

[英]Installing boost using MinGW 64 - (Cygwin)

我正在嘗試安裝Boost庫(1.53)以在Windows下的64位應用程序中使用它。 但是,在嘗試以與MinGW32和較早的boost版本相同的方式進行設置時,遇到了一系列錯誤...

現在,我一直在第一步失敗-執行./bootstrap.sh。 返回以下錯誤:

mkdir bootstrap
gcc -o bootstrap/jam0 command.c compile.c constants.c debug.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathunix.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c pwd.c class.c native.c md5.c w32_getreg.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c execunix.c fileunix.c
function.c: In function ÔÇścheck_alignmentÔÇÖ:
function.c:222:5: warning: cast from pointer to integer of different size
builtins.c:33:23: fatal error: sys/wait.h: No such file or directory
compilation terminated.
execunix.c:17:26: fatal error: sys/resource.h: No such file or directory
compilation terminated.
fileunix.c:98:17: fatal error: ar.h: No such file or directory
compilation terminated. 

相反,當我運行bootstrap.bat時,Boost.Build會自行構建,但是稍后會出現奇怪的錯誤。 最初,我嘗試將x86_64-w64-mingw32-gcc等可執行文件符號鏈接到gcc,但是最終出現了許多“訪問被拒絕”錯誤,因此我只是將x86_64-w64-mingw32-XX文件復制粘貼到了簡單的XX中.exe文件。 現在,我可以開始正確的構建,但最終得到:

...failed gcc.archive bin.v2\libs\thread\build\gcc-mingw-4.5.3\debug\address-model-64\link-static\threading-multi\libboost_thread-mgw45-mt-d-1_53.a...
gcc.archive bin.v2\libs\thread\build\gcc-mingw-4.5.3\release\address-model-64\link-static\threading-multi\libboost_thread-mgw45-mt-1_53.a
System cannot find the path specified.
System cannot find the path specified.

我發現,它正在嘗試使用類似於Win的路徑斜杠(/ vs \\),並且可能因此失敗。

我不想使用MSVC,因為我試圖使我的代碼盡可能地可移植,因此對於64位來說也很關鍵。

提前致謝。

看起來好像Cygwin安裝中的文件丟失。 嘗試再次運行安裝程序,並確保為gcc編譯器(Cygwin,而不是MinGW64)安裝了所有內容。 我成功運行了bootstrap.sh,使用默認的Cygwin gcc編譯器很好地編譯了bjam。 之后,我遇到了一些減速,但是使用MinGW64可以正常編譯。 我在tools \\ build \\ v2 \\ user-config.jam中添加了編譯器可執行文件,如下所示:

using gcc : 4.5.3 : x86_64-w64-mingw32-gcc.exe ;

我最終得到以下命令行:

./b2 --toolset=gcc target-os=windows --build-dir=/cygdrive/c/whatever/boost_build variant=debug,release link=static runtime-link=static architecture=x86 address-model=64 threadapi=win32 --layout=tagged --without-mpi --stagedir=lib/win64gcc -j4 stage

...然后我嘗試使用link=shared runtime-link=shared ,但是我有很多編譯錯誤,但我還沒有弄清楚。

一些鏈接可能會幫助您:

編輯:我最終使用了MinGW64 TDM,它比Cygwin MinGW64容易得多,因為它不是交叉編譯器。 只需安裝MinGW64 TDM,添加MSYS,就完成了! Boost編譯沒有任何問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM