MinGw編譯Boost
(金慶的專欄)
在MinGw Shell中運行bootstrap.sh失敗
Jinq@jinqing-pc /d/src/boost_1_52_0
$ bootstrap.sh toolset=gcc
Building Boost.Build engine with toolset gcc...
Failed to build Boost.Build build engine
Consult 'bootstrap.log' for more details
bootstrap.log顯示如下:
###
### Using 'gcc' toolset.
###
rm -rf bootstrap
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
builtins.c:33:23: 致命錯誤:sys/wait.h:No such file or directory
編譯中斷。
execunix.c:17:26: 致命錯誤:sys/resource.h:No such file or directory
編譯中斷。
fileunix.c:98:17: 致命錯誤:ar.h:No such file or directory
編譯中斷。
按照 http://lists.boost.org/boost-users/2011/06/69016.php
解決如下:
Jinq@jinqing-pc /d/src/boost_1_52_0/tools/build/v2/engine
$ ./build.sh mingw
Jinq@jinqing-pc /d/src/boost_1_52_0/tools/build/v2/engine/bin.ntx86
$ cp b2.exe /d/src/boost_1_52_0
Jinq@jinqing-pc /d/src/boost_1_52_0
$ b2 toolset=gcc stage
按照 https://svn.boost.org/trac/boost/ticket/4884#comment:10
可能正確的方法是在cmd.exe視窗中運行bootstrap.bat來產生b2.exe.
不過這樣就需要另外設定gcc的路徑。
bootstrap.sh是不支援在MinGW Shell中啟動並執行。