c++ - 使用Cmake编译LZO时提示找不到任何VS实例

标签 c++ cmake

我已经安装了 VS2015 (win64),我想用 Cmake 编译 LZO 生成一个 VS 项目,但是 Cmake 显示这个:

CMake Error at CMakeLists.txt:51 (project):
  Generator
    Visual Studio 15 2017 Win64
  could not find any instance of Visual Studio.

我认为问题可能来自 Cmakelist.txt 文档,但我不知道如何解决... CmakeList.txt文件的第51行是:

if(",${CMAKE_SOURCE_DIR}," STREQUAL ",${CMAKE_BINARY_DIR},")
    message(FATAL_ERROR "ERROR: In-source builds are not allowed.")
endif()

if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()

project(lzo VERSION 2.10 LANGUAGES C++)

最佳答案

Generator Visual Studio 15 2017 Win64 是 Visual Studio 2015 的错误生成器。您需要 Visual Studio 14 2015 Win64 如果您有从 Visual Studio 2015 x64 命令提示符执行 cmake-gui 的问题,以便您设置编译器环境变量。

关于c++ - 使用Cmake编译LZO时提示找不到任何VS实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49278766/

相关文章:

c++ - 调用链接器时是否可以强制 CMake 重新排序参数?

c++ - 为什么我的 Redhat 服务器上的 QuickFIX 进程没有将它的核心文件写到它应该写的地方?

c++ - 是否考虑函数中的代码?

android - CMake 构建失败,因为找不到 STL 库

cmake - 如何在另一个文件夹中添加源文件

visual-studio - CMake:如何使用不同的 ADD_EXECUTABLE 进行调试构建?

c++ - boost::asio::write 时出错

c++ - 读入不同类型的行

c++ - 使用 HDF5 C++ 编写动态大小的复合类型数据集

c++ - 从另一个命名空间访问标准命名空间数据成员