简体   繁体   English

在没有Visual Studio的Windows上安装C ++ Boost库

[英]Installing C++ Boost library on Windows without Visual Studio

I would like to install Boost library without the need of Visual Studio compiler, preferably by downloading the pre-compiled binaries. 我想在不需要Visual Studio编译器的情况下安装Boost库,最好下载预编译的二进制文件。 We are working on a cross-platform C++ project in Eclipse, so VS is out of option. 我们正在Eclipse中开发一个跨平台的C ++项目,因此VS不再可行。

About a year ago, I found an installer, but it does not longer exists. 大约一年前,我找到了一个安装程序,但是它不再存在。 The best match I have found so far is from: http://www.boostpro.com/download/ but it seems like this one includes a lot of stuff related to VS. 到目前为止,我发现最好的匹配项来自: http : //www.boostpro.com/download/,但是似乎其中包括很多与VS相关的内容。

If there is no installer available, is there an easy way of compiling it like the on *NIX platforms? 如果没有可用的安装程序,是否可以像* NIX平台上那样简单地进行编译?

(I know that the majority of the library is header-only, but I would like some parts which are not) (我知道该库的大部分内容仅是标头,但我希望某些部分不是标头)

Whichever toolchain that you are going to use on Windows, you can use that toolchain to compile Boost easily. 无论您要在Windows上使用哪种工具链,都可以使用该工具链轻松编译Boost。

For example, if you use Eclipse CDT for C++ on Windows, you can use either MinGW or Cygwin toolchain. 例如,如果在Windows上使用Eclipse CDT for C ++,则可以使用MinGW或Cygwin工具链。 Then simply start the command prompt that has those toolchains (make, gcc, ...) in your path. 然后,只需启动路径中包含那些工具链(make,gcc,...)的命令提示符即可。 Go to the Boost folder you downloaded. 转到您下载的Boost文件夹。 Run the bootstrap file to generate bjam. 运行引导程序文件以生成bjam。 Then run bjam. 然后运行bjam。

On a side note, if you want a cross-platform C++ project, you don't have to use a cross-platform IDE. 附带说明一下,如果您想要跨平台的C ++项目,则不必使用跨平台的IDE。 You can use CMake as your build generator and then use any IDE you want. 您可以将CMake用作构建生成器,然后使用所需的任何IDE。

One option is to get the full Boost source and then compile your own application to statically link in everything from Boost. 一种选择是获取完整的Boost源,然后编译您自己的应用程序以静态链接Boost中的所有内容。 If you manage to do this correctly, there will be no need to bundle the Boost binaries on any platform. 如果您设法正确执行此操作,则无需在任何平台上捆绑Boost二进制文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM