【问题标题】:Command parameters for b2 in order to build Boost libraries with Microsoft's Clang/C2b2 的命令参数,以便使用 Microsoft 的 Clang/C2 构建 Boost 库
【发布时间】:2016-11-04 07:35:58
【问题描述】:

我一直在尝试在 Windows 中使用 b2 编译 Boost 库,但使用 Clang/C2(带有 Microsoft CodeGen 的 Clang 3.7),但没有成功。由于 Visual Studio 附带了几个在构建时使用的工具集,因此指定哪个似乎不难。我看过另一篇关于“在 windows 上使用 clang 3.8 构建 boost”的帖子,但他建议用作 b2 的命令行是错误的,因为它并没有真正从 MSVC 调用 clang 编译器。使用以下命令行发帖的人:

b2 --build-dir=build toolset=clang --build-type=complete stage

我对 b2 和 Boost.Build 工具不熟悉...我只想将来自 MSVC 的 Boost 与 Clang/C2 一起使用,而不是使用默认编译器。

任何反馈将不胜感激..

胡安·登特

顺便说一句:我正在使用 Visual Studio 2015 Update 3。

【问题讨论】:

  • 是什么让您认为这是 Boost 支持的构建路径?
  • 嗯,clang 是一个主要的跨平台编译器,它在 VStudio 中的可用性似乎表明微软希望为这个编译器提供支持。我实际上会问为什么不支持它?
  • 因为 Clang/C2 是新的;它还不到 6 个月大。对这样的事情的支持不会神奇地出现。根据release notes for the 1.61 release,他们甚至没有在 Clang/C2 上进行测试。
  • 我明白...我想知道成为 Boost 中的一个选项需要多长时间...谢谢@NicolBolas!

标签: c++ c++11 boost clang


【解决方案1】:

boostmac os x 上支持clang,因此它应该在windowslinux 上构建它。

windows boost 默认为visual studio 构建。在为mingw 构建时,我在b2 之前运行bootstrap.bat mingw。因此,要在windows 上为clang 构建,请确保clangPATH 中并尝试:

cd boost_1_xx_0
bootstrap.bat clang

b2 -j8 toolset=clang address-model=64 architecture=x86 --build-dir=build --build-type=complete stage

【讨论】:

  • 'clang++' 不是内部或外部命令、可运行程序或批处理文件。这是执行命令行时的错误消息
  • 很遗憾听到它不起作用。显然,boost 尚不支持windows 上的clang,请参阅clang++ on windows support 以了解解决方法。
猜你喜欢
  • 1970-01-01
  • 2016-11-15
  • 1970-01-01
  • 1970-01-01
  • 2021-07-05
  • 2012-06-11
  • 1970-01-01
  • 1970-01-01
  • 2021-05-23
相关资源
最近更新 更多