- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我一直在尝试将适用于 C++ 的 AWS 开发工具包集成到我的 Netbeans 项目中。我尝试使用 cmake 命令,但失败并出现以下错误。
这是在命令提示符下运行命令的文本
C:\Users\jense\Desktop\code libraries\aws-sdk-cpp-master\aws-sdk-cpp-master>"C:\Users\jense\Desktop\code libraries\cmake-3.8.2-win64-x64\cmake-3.8.2-win64-x64\bin\cmake" .
-- Could NOT find Git (missing: GIT_EXECUTABLE)
-- TARGET_ARCH not specified; inferring host OS to be platform compilation target
-- Building AWS libraries as shared objects
-- Generating windows build config
-- Building project version: 1.1.10
-- The CXX compiler identification is GNU 5.3.0
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe
CMake Error: Generator: execution of make failed. Make command was: "nmake" "/NOLOGO" "cmTC_ade23\fast"
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe -- broken
CMake Error at C:/Users/jense/Desktop/code libraries/cmake-3.8.2-win64-x64/cmake-3.8.2-win64-x64/share/cmake-3.8/Modules/CMakeTestCXXCompiler.cmake:44 (message):
The C++ compiler "C:/MinGW/bin/g++.exe" is not able to compile a simple
test program.
It fails with the following output:
Change Dir: C:/Users/jense/Desktop/code libraries/aws-sdk-cpp-master/aws-sdk-cpp-master/CMakeFiles/CMakeTmp
Run Build Command:"nmake" "/NOLOGO" "cmTC_ade23\fast"
Generator: execution of make failed. Make command was: "nmake" "/NOLOGO"
"cmTC_ade23\fast"
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:105 (project)
-- Configuring incomplete, errors occurred!
See also "C:/Users/jense/Desktop/code libraries/aws-sdk-cpp-master/aws-sdk-cpp-master/CMakeFiles/CMakeOutput.log".
See also "C:/Users/jense/Desktop/code libraries/aws-sdk-cpp-master/aws-sdk-cpp-master/CMakeFiles/CMakeError.log".
这是我的 CMakeError.txt
Determining if the CXX compiler works failed with the following output:
Change Dir: C:/Users/jense/Desktop/code libraries/aws-sdk-cpp-master/aws-sdk-cpp-master/CMakeFiles/CMakeTmp
Run Build Command:"nmake" "/NOLOGO" "cmTC_a5997\fast"
Generator: execution of make failed. Make command was: "nmake" "/NOLOGO" "cmTC_a5997\fast"
在我的 CMakeOutput.txt
中
The CXX compiler identification is GNU, found in "C:/Users/jense/Desktop/code libraries/aws-sdk-cpp-master/aws-sdk-cpp-master/CMakeFiles/3.8.2/CompilerIdCXX/a.exe"
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: C:/MinGW/bin/g++.exe
Build flags:
Id flags:
The output was:
0
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.exe"
它说 g++
不能编译一个简单的测试程序,但是它似乎在我的其他 c++
程序上运行良好。此外,它指示我运行 nmake
/NOLOGO
cmTC_a5997\fast
。我在我的计算机上找不到安装的 nmake,这是问题所在吗?或者这只是一系列错误中发生的另一个错误?
我该如何解决这个问题?
我使用的是 Netbeans 8.2 而不是 Visual Studio。
我在 SO 上看到的所有答案似乎都与我的问题无关,它们是与 visual studio 相关的答案和/或解决我没有的问题的东西。
谢谢!
最佳答案
NMake 是 Microsoft 工具链中的传统 make 程序。由于您使用 MinGW,因此您需要 mingw32-make,但 CMake 默认为 Windows 上的 MS 工具链生成器。使用 -G "MinGW Makefiles"
调用 CMake 以切换到 MinGW 生成器。
-G "Unix Makefiles"
,就像 Miles Budnek 在问题评论中建议的那样,是类 Unix 目标的默认生成器。例如,它是 Linux 上的默认值。但是,它不与 MinGW 相同,不会在您的情况下工作。
附言1:尤其是在 Windows 上,make 在使用所有 CPU 核心方面存在问题。您可能想看看 Ninja .它通常是 make 的直接替代品,可以使用 CMake 的 -G Ninja
激活,并且可以更好地处理并行构建。
附言2(与问题无关):避免在目录路径中的任何位置使用空格。这些是麻烦的主要来源,因为您必须在任何地方正确地引用这些路径。这是 (a) 出奇地难以正确,(b) 一些你很容易完全忘记的事情,以及 (c) 一些你所有的第 3 方依赖项的构建系统也需要具备的能力。不使用空格是避免所有这些潜在陷阱的最简单方法。
关于c++ - C++ 编译器 g++.exe 无法编译简单的测试程序 - 确定 CXX 编译器是否工作失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45124655/
关闭。这个问题是opinion-based .它目前不接受答案。 想要改进这个问题? 更新问题,以便 editing this post 可以用事实和引用来回答它. 关闭 3 年前。 Improve
我目前正在从事类似bash的项目。但是,我需要使用数千个测试来测试该项目,而这些测试无法手动检查。这就是为什么我想自动执行测试。 我的程序使用fgets()来获取用户输入。我知道如何直接向程序发送参数
我想在 Android 中编写一个原生应用程序进行测试表面抛物线。是否有任何简单的程序显示如何创建Surfaceflinger 上的表面、寄存器缓冲区和后置缓冲区。 最佳答案 frameworks/b
有一个对象依赖于计时来正常运行。不幸的是,计时持续时间本身太长,无法实时对其进行实际测试,并且由于对象的性质,缩短持续时间违背了测试的目的。 测试此类对象的最佳方法是什么?理想情况下,会有一些可以使用
我首先要说的是,我是一名几乎没有 C++ 经验的大学生。你听对了多少次?我正在使用 libnodave 库中的测试程序 testISO_TCP(简化版)。该程序在连接到 seimens 300 PLC
我正在尝试构建一个非常简单的libodbc++程序。最近,我们注意到了一个奇怪的内存泄漏,我们认为这是由于ODBC++和IDS驱动程序之间的某个地方引起的-我正在编写一个测试来证明这一点。 我使用以下
我对 JavaScript 还很陌生,我有一点疑问。 我创建了这个 JSFiddle:https://jsfiddle.net/AndreaNobili/1up938xf/ 我只定义了执行简单求和(无
我用三个类文件在 IntelliJ 中创建了一个 maven 项目: package mavenKris; import org.apache.hadoop.io.Text; import org.a
我下载了包含 freeglut 的“非官方 OpenGL 软件 SDK”,但我似乎无法让它工作。我在 Windows 上。我在 Visual Studio 2010 或 MinGW g++ 上都没有成
我正在尝试使用 std::async 在 C++ 中调用异步函数按照这个官方cplusplus.com示例代码。 不幸的是,编译失败了。运行时 mingw32-make ,我收到以下错误: main.
我是一名优秀的程序员,十分优秀!