所以,我不得不问一个非常低级的问题,但我已经在互联网上到处寻找,我似乎找不到答案。
因此,我决定将Boost与Code::块一起使用。我使用了BoostPro Installer并安装了最新版本,即1.51.0。
所以,我的Boost文件夹所在的目录是:
C:/Program files/boost该目录中还包含一个文件夹,因此如下所示:
C:/Program files/boost/boost_1_51所以,我的问题是,如何设置我的Code::代码块才能正常工作。我做了以下工作:
转到设置>全局变量,创建了一个名为boost的新变量。
将其基数设置为: C:\Program Files\boost\boost_1_51
将其包含设置为: C:\Program Files\boost\boost_1_51\boost
然后,我转到我的项目,右键单击它>构建选项>突出显示我的根项目>搜索目录。
然后,在我的Compiler子选项卡下,我单击Add并添加以下内容:
$(#boost.include)在Linker子选项卡下,我单击Add并添加了以下内容:
$(#boost.lib)而且我似乎无法编译示例代码(位于官方Boost网站>入门)。
提前感谢!
发布于 2012-09-27 21:46:11
CodeBlocks维基包含有关设置boost:http://wiki.codeblocks.org/index.php?title=BoostWindowsQuickRef的说明
特别是,对于从源代码构建boost,请查看Build Boost一节,并确保选择正确的工具集(在您的示例中,我假设在使用MinGW时它应该是--toolset=gcc )。
发布于 2013-02-16 01:51:46
为了使用Filesystem,我使用了另一台计算机,并执行了以下步骤,它正常工作:
1) Installed MinGW
2) Added this enviroment variable => C:\MinGW\bin
3) bootstrap.bat gcc
4) b2 install --prefix="C:\Boostbuild" --toolset=gcc
5) Added this enviroment variable => C:\Boostbuild\bin
6) b2 --build-dir="C:\Boostbuild" toolset=gcc --build-type=complete stage
7) Installed CodeBlocks without MinGW
CodeBlocks:
8) Settings->Global variables: current variable => boost, Base => C:\boost_1_53_0, include => C:\boost_1_53_0\stage\lib
9) On the new C++ console project:
Build Options->Choose Project Name on the left -> search directories
On compiler tab, press Add and type: $(#boost)
On linker tab, press Add and type: $(#boost.lib)
10) On the new C++ console project:
Build Options->Choose Project Name on the left -> linker settings
Add the following link libraries:
..\..\boost_1_53_0\stage\lib\libboost_filesystem-mgw46-mt-1_53.a
..\..\boost_1_53_0\stage\lib\libboost_system-mgw46-mt-1_53.a谢谢大家
https://stackoverflow.com/questions/12617134
复制相似问题