【问题标题】:How to use Visual c++ compiler to run Cmake for boost 1.39.0 building library如何使用 Visual c++ 编译器运行 Cmake for boost 1.39.0 构建库
【发布时间】:2014-07-10 12:16:17
【问题描述】:

我需要编译 boost 1.39.0 library 在这个版本上,不提供安装程序以运行 Visual Studio 2008 解决方案。 Cmake 抛出这个异常。

-- Building for: Visual Studio 9 2008
 -- The C compiler identification is unknown
 -- The CXX compiler identification is unknown

 CMake Error at CMakeLists.txt: 28 (project):
  No CMAKE_C_COMPILER could be found.
  No CMAKE_CXX_COMPILER could be found.

我不知道如何指定在哪里可以找到 Visual Studio 编译器。

我正在使用 boost 1.39.0CMake 3.0.0

亲切的问候。

【问题讨论】:

  • 这个问题似乎是题外话,因为它不是英文的
  • 你也可以在调用cmake之前设置CCCXX环境变量指向VS2008的cl.exeSee this.
  • 感谢您的帮助,彼得,但我怎么能在 Windows 中使用命令行来做到这一点,我看到它参考了 Linux 的说明。
  • 打开 Visual Studio 命令提示符(开始->VisualStudio->VisualStudio 工具->...) - 所有相关的环境变量都会自动设置。在那里运行cmake

标签: c++ visual-studio-2008 boost cmake windows-7-x64


【解决方案1】:

我通常用 bjam 构建 Boost:

  1. 运行 bootstrap.bat(它是 boost 源的根目录)。这将创建一个 bjam.exe。
  2. 运行 bjam。使用此参数(对于 64 位):
    bjam toolset=msvc-9.0 --build-type=complete address-model=64 阶段

您将在 stage 目录中找到所有已构建的二进制文件。 请参阅this 了解更多信息。

【讨论】:

  • 嗨 Tomas,感谢您的帮助,我怎么能看到 bjam 在编译期间抛出的所有警告,我担心这可能会导致我的应用程序。
猜你喜欢
  • 1970-01-01
  • 2019-12-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-07-10
  • 2020-04-28
  • 1970-01-01
相关资源
最近更新 更多