如何在Code :: Blocks(Windows)上构建Boost库? [英] How do I build Boost libraries on Code::Blocks (Windows)?

查看:114
本文介绍了如何在Code :: Blocks(Windows)上构建Boost库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

U,我很累.我对此事的所有搜索都徒劳无功.无论我找到多少解决方案,我都无法找到构建Boost的库的方法.

Ugh, I'm tired. All of my searches on the matter have been in vain. No matter how many solutions I find, I just cannot find a way to build Boost's libraries.

因此,我可以简单地将'boost'根目录放入Code Block的'include'中,而无需构建大多数库.那么,如何分别构建非仅标头的库?

So, I can simply throw the 'boost' root directory into Code Block's 'include' and skip building the majority of libraries. How do I, then, build separately the non-header-only libraries?

请注意,我是.bat,cmd和所有这些东西的完整门外行.即使我对已经发现的实际解决方案进行了任何尝试,也无法做出任何实际指示的事情.

Please, mind you that I'm a complete layman towards .bat, cmd, all this stuff. Even if anything I tried of the supposed solutions I've found already actually could work, I just cannot make head or tails of anything that is actually instructed.

伙计,我只想能够使用boost :: thread的. :我

Man, I just want to be able to use boost::thread's. :I

推荐答案

然后,如何分别构建非仅标头的库?"

"How do I, then, build separately the non-header-only libraries?"

例如,如果您使用MinGW作为编译器选择,然后打开命令提示符,请导航到您下载/提取的boost根目录,并以以下方式运行bootstrap.bat命令:

If you are using MinGW for example as your compiler choice then open up a command prompt, navigate to the boost root directory that you downloaded/extracted and run the bootstrap.bat command in the following manner:

bootstrap.bat mingw

bootstrap.bat mingw

b2.exe

运行bootstrap命令将生成与MinGW相关的库文件(默认为stage/lib子目录),您需要在Code :: Blocks中链接到该文件,例如,其中包括Boost.Threads所需的文件. :

Running the bootstrap command will generate the MinGW-related library files (defaulting to the stage/lib subdirectory) that you will need to link to within Code::Blocks, which will include the one you needed for Boost.Threads for example:

然后在CodeBlocks中,您将需要

And then in CodeBlocks you will need to

  1. 在搜索中设置Boost根目录的位置
  2. 选择链接器"选项卡并设置库文件的位置
  3. 选择链接器设置"选项卡,添加必要的库名称,例如

请参阅此链接以获取更多屏幕截图和说明:

See this link for more screenshots and explanations:

http://www. technical-recipes.com/2014/configuring-codeblocks-to-use-the-boost-libraries/

这篇关于如何在Code :: Blocks(Windows)上构建Boost库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆