簡體   English   中英

使用CodeBlocks在Windows上設置Boost

[英]Setting up Boost on Windows with CodeBlocks

我想使用Boost Filesystem庫,我正在嘗試在我的Windows機器上安裝Boost。 我正在使用CodeBolcks進行開發。 我做了以下:

1)我下載並解壓縮到:d:\\ boost_1_53_0

2)我下載並解壓縮可執行文件到:d:\\ boost-jam-3.1.18-1-ntx86

3)我在我的PATH環境變量中添加了“d:\\ boost-jam-3.1.18-1-ntx86”。

4)我轉到“d:\\ boost_1_53_0”,然后運行以下命令:

bjam --toolset=gcc "--prefix=D:\Program Files\CodeBlocks" install

我得到以下輸出:

warning: mismatched versions of Boost.Build engine and core
warning: Boost.Build engine (bjam) is 03.1.18
warning: Boost.Build core (at D:/boost_1_53_0/tools/build/v2) is 2011.12-svn
D:/boost_1_53_0/tools/build/v2/util\path.jam:476: in path.makedirs
rule MAKEDIR unknown in module path.
D:/boost_1_53_0/tools/build/v2/build\configure.jam:190: in configure.set-log-file
D:/boost_1_53_0/tools/build/v2\build-system.jam:725: in load
D:\boost_1_53_0\tools\build\v2/kernel\modules.jam:283: in import
D:\boost_1_53_0\tools\build\v2\kernel\bootstrap.jam:142: in boost-build
D:\boost_1_53_0\boost-build.jam:17: in module scope

有人知道如何解決這個問題嗎?

謝謝

更新1:

根據您的建議,我嘗試使用Boost文件夾中的bootstrap.bat。 但是,我收到了以下輸出:

D:\boost_1_53_0>bootstrap.bat gcc
Building Boost.Build engine

Failed to build Boost.Build engine.
Please consult bootstrap.log for furter diagnostics.

You can try to obtain a prebuilt binary from

   http://sf.net/project/showfiles.php?group_id=7586&package_id=72941

Also, you can file an issue at http://svn.boost.org
Please attach bootstrap.log in that case.

bootstrap.log文件包含以下內容:

###
### Using 'gcc' toolset.
###

D:\boost_1_53_0\tools\build\v2\engine>if exist bootstrap rd /S /Q bootstrap 

D:\boost_1_53_0\tools\build\v2\engine>md bootstrap 

D:\boost_1_53_0\tools\build\v2\engine>gcc -DNT -o bootstrap\jam0.exe  command.c compile.c constants.c debug.c execnt.c filent.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 md5.c pwd.c class.c w32_getreg.c native.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c 

D:\boost_1_53_0\tools\build\v2\engine>.\bootstrap\jam0 -f build.jam --toolset=gcc "--toolset-root= "  clean 
...found 1 target...
...updating 1 target...
...updated 1 target...

D:\boost_1_53_0\tools\build\v2\engine>.\bootstrap\jam0 -f build.jam --toolset=gcc "--toolset-root= "  
...found 50 targets...
...updating 2 targets...
[COMPILE] bin.ntx86\b2.exe

"gcc"   -o bin.ntx86\b2.exe "-DNDEBUG" "-DOPT_HEADER_CACHE_EXT" "-DOPT_GRAPH_DEBUG_EXT" "-DOPT_SEMAPHORE" "-DOPT_AT_FILES" "-DOPT_DEBUG_PROFILE" "-DOPT_FIX_TARGET_VARIABLES_EXT" "-DOPT_IMPROVED_PATIENCE_EXT" "-DNT" "-DYYSTACKSIZE=5000" "-pedantic" "-fno-strict-aliasing" "-s" "-O3" "-Wno-long-long" "command.c" "compile.c" "constants.c" "debug.c" "function.c" "glob.c" "hash.c" "hcache.c" "headers.c" "hdrmacro.c" "jam.c" "jambase.c" "jamgram.c" "lists.c" "make.c" "make1.c" "mem.c" "object.c" "option.c" "output.c" "parse.c" "regexp.c" "rules.c" "scan.c" "search.c" "subst.c" "w32_getreg.c" "timestamp.c" "variable.c" "modules.c" "strings.c" "filesys.c" "builtins.c" "pwd.c" "class.c" "native.c" "md5.c" "modules/set.c" "modules/path.c" "modules/regex.c" "modules/property-set.c" "modules/sequence.c" "modules/order.c" "execnt.c" "filent.c" "pathunix.c" 

...failed [COMPILE] bin.ntx86\b2.exe...
...removing bin.ntx86\b2.exe
...skipped bjam.exe for lack of b2.exe...
...failed updating 1 target...
...skipped 1 target...

你有什么建議嗎?

更新2:

D:\boost_1_53_0\tools\build\v2>bootstrap.bat gcc
Bootstrapping the build engine

Failed to bootstrap the build engine
Please consult bootstrap.log for furter diagnostics.

bootstrap.log文件包含與UPDATE 1中相同的內容。問題出在哪里? 謝謝

您必須已從另一個源(不是boost tar分配附帶的源)安裝了boost.build軟件包。

如果您想擺脫警告,則需要在與boost分發相同的軟件包中安裝boost-build。 要確保它們完全相同並且是最新的,只需從此處下載boost並將其解壓縮即可。 完成后,按照安裝說明(基本上是bootstrap然后是b2 ),進入tools / build / v2並執行bootstrap.shb2 然后你將生成對應於此boost版本的b2和bjam文件,並且不再有此警告。

通過右鍵單擊我的計算機和屬性,將%PATH%變量設置為'gcc.exe'駐留在envs變量中的位置,然后重新啟動提示並再次運行。

暫無
暫無

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

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