如何使用Visual c++编译器运行Cmake for boost 1.39.0构建库

How to use Visual c++ compiler to run Cmake for boost 1.39.0 building library

本文关键字:boost 构建 for Cmake Visual 何使用 c++ 编译器 运行      更新时间:2023-10-16

我需要编译boost 1.39.0库,在这个版本上,不提供安装程序,以便运行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

亲切的问候。

我通常使用bjam:

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

您将在stage目录中找到所有构建的二进制文件。