我试图使用cmake和mingw来编译我的项目,但是得到了错误:
cmake -G "MinGW Makefiles" ../
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: D:/mingw/bin/gcc.exe
-- Check for working C compiler: D:/mingw/bin/gcc.exe -- broken
CMake Error
我有一个运行macOS 10.12的Jenkins构建服务器。 我正在使用最新的Clang10(不是AppleClang)和CMake 3.17编译一个C++应用程序。 我得到的错误是: The C++ compiler
"/Users/XXX/llvm/bin/clang++"
is not able to compile a simple test program.
It fails with the following output:
ld: unknown option: -platform_version
clang-10: error: linker fa
我很想把我们的项目升级到C++20。
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
但我觉得这不是正确的方法。正确的方法是什么?是这个吗?
target_compile_features(Foo PUBLIC cxx_std_20)
Foo在哪里是我的目标的名称(每个目标的名称相同?)如果我这样做,我是否把所有的set (CMAKE_CXX_STANDARD*)行都删除了?
沿着同样的路线,如果我有
target_compile_features(Foo PUBLIC cxx_std_20)
target_co
也许在这个论坛上已经有了一些关于这个问题的答案,但是我已经尝试了很多解决方案,但我仍然没有解决这个问题。
我必须使用C++制作一个安卓应用程序,而wich则使用libcurl。
不管我做什么,我都不能运行我的程序,因为它能找到库。
在我的.cpp中,我使用以下一行:
#include <curl/curl.h>
这是我的CMakeLists.txt
# Sets the minimum version of CMake required to build the native
# library. You should either keep the default value o
我现在正试图用cmake在linux中构建一个c++库。如果不启用-std=c++0x选项,则始终会获得下列代码的编译错误error: 'div_t' was not declared in this scope:
int xPos;
div_t divResult;
divResult = div(xPos,8);
如果我用cmake:set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x"启用-std++0x选项,那么一切都很好。但是,在我的库中,我没有使用任何c+
我使用的回购要求至少cmake 3.12。我有cmake 3.10.2,所以我将其更新为cmake 3.17.0。现在,当我运行cmake --version时,cmake version 3.17.0会跟踪。但是,当我使用回购时,仍然会出现以下错误
CMake Error at CMakeLists.txt:5 (cmake_minimum_required):
CMake 3.12 or higher is required. You are running version 3.10.2
有人知道吗?
在Visual代码中,它显示了当我想构建我的项目时:
CMake 3.9 or higher is required. You are running version 3.3.2
我不知道如何升级cmake版本..。
它仍然显示:
$ cmake --version
cmake version 3.3.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
$ sudo cmake --version
cmake version 3.22.1
CMake suite maintained and sup
在Windows上运行QT Creator。我有一个软件包,它警告我g++ 4.7中的一个错误,所以我下载了mingw4.6.2版的g++。问题是,当我通过QT creator运行cmake时,它似乎仍然指向旧目录(我现在已经删除了它)。下面是我运行cmake时的控制台输出:
CMake Error: your RC compiler: "C:/MinGW-4.7.1/bin/windres.exe" was not found. Please set CMAKE_RC_COMPILER to a valid compiler path or name.
CMake
我对C++编程和cmake非常陌生。如果这个问题看起来简单的话,请容忍我。
我正在构建一个应用程序,其中cmake 3.9.0是所需的最低版本。
Setup.sh: Building rpclib with libc++.
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
CMake 3.9.0 or higher is required. You are running version 3.5.1
因此,我计划升级cmake版本,并遵循下面的链接。
注意:为了明确起见,我不想清除现有版本,因为它可能会影响我的系统中的R
我正在尝试使用C为OBS创建一个插件,并使用cmake .. && make - 编译它。
当从cmd运行cmake .. && make时,它会给出一个cmake: command not found错误,当我从程序运行它时,它会给出一个错误- CMake Error: The source directory "/Users/gerwin/Desktop/soOBS" does not appear to contain CMakeList.text specify --help for usage, or press the help bu
我正在使用Visual Studio Code进行Cmake的C++开发。通常,build命令F7会运行使用cmake来构建项目,但现在当我运行build任务时,我会收到一个警告command 'cmake.build' not found,此后什么也不会发生,因此项目永远不会构建。
我在Ubuntu nad上运行,已经安装了cmake依赖和CMake工具,以及命令行Cmake、ccmake和cmake-gui。我已经卸载并重新安装了apt-get清除代码,并重新安装了我的$HOME/.vscode扩展名。
QtCreator向我显示了这条错误消息,并要求我浏览并选择一个cmake可执行文件:
/usr/bin/cmake: error while loading shared libraries: libgssapi_krb5.so.2: cannot open shared object file: No such file or directory
我在Ubuntu12.04上安装了OGRE1.8.1(源包),一切正常(我设法在Ogre3D界面上运行了一些示例)。然而,当我编译一个需要OpenCV、ArUco和Ogre库的外部项目()时,我遇到了一个问题。当我运行项目的CMake时,我收到以下信息:
CMake Error at CMakeLists.txt:46 (find_package):
By not providing "FindOGRE.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration
我正在使用Visual Studio打开一个CMake C++项目。当我将其设置为顶部的x64-Debug模式并编译时,它可以正常工作。但是,当我将它更改为x64-Release时,它突然告诉我:
CMake Error at CMakeLists.txt:5 (project):
Generator
Visual Studio 16 2019
could not find any instance of Visual Studio.
我真的在使用Visual Studio,为什么CMake在构建发布模式时不再找到它?我知道这个代码库以前编译得很好,从那以后我就没有对它做过任何修改。此外,我试