【问题标题】:Netbeans has stopped compiling C++ what did I break?Netbeans 已停止编译 C++ 我破坏了什么?
【发布时间】:2016-01-22 22:08:48
【问题描述】:

我在 Windows 7 64 笔记本电脑上运行 并尝试使用 NetBeans 开发 C++。

我真的对 makefile 或 cygwin 或整个生态系统知之甚少,所以这对我来说是个谜。

我安装 NetBeans (8.0) 的前一年运行良好。

昨天我尝试使用它,但它似乎已经停止工作。 这可能是因为我尝试了很多东西来尝试让 NDK 开发为 Eclipse 工作,并移动了一些东西或更改了关键的系统变量。

我在这方面失败了,但可能把我的系统弄得更糟。

我尝试安装新版本的 NetBeans (8.1),但收到了各种关于 JDK 的消息。

尽管与它斗争了几个小时,但我无法修复这些消息,但它似乎让我打开了一个简单的程序并尝试编译它,但编译又失败了。

自从我上次使用 NetBeans 以来,我还安装了 Visual C++ 2015 (至少这适用于 NDK 工作)

帮助!

int main(int argc, char** argv) {
    return 0;
}

当我按下锤子和扫帚图标(清理并编译)时,我收到以下错误消息:

"/C/MinGW/MSYS/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= 
SUBPROJECTS= .clean-conf
make.exe[1]: Entering directory `/c/Users/Andre/Documents/NetBeansProjects/hello compiler'
rm -f -r build/Debug
rm -f dist/Debug/MinGW-Windows/hello_compiler.exe
make.exe[1]: Leaving directory `/c/Users/Andre/Documents/NetBeansProjects/hello compiler'
CLEAN SUCCESSFUL (total time: 853ms)
"/C/MinGW/MSYS/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/Users/Andre/Documents/NetBeansProjects/hello compiler'
"/C/MinGW/MSYS/1.0/bin/make.exe"  -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/hello_compiler.exe
make.exe[2]: Entering directory `/c/Users/Andre/Documents/NetBeansProjects/hello compiler'
mkdir -p build/Debug/MinGW-Windows
rm -f "build/Debug/MinGW-Windows/main.o.d"
g++    -c -g -MMD -MP -MF "build/Debug/MinGW-Windows/main.o.d" -o build/Debug/MinGW-Windows/main.o main.cpp
make.exe[2]: *** [build/Debug/MinGW-Windows/main.o] Error 1
make.exe[2]: Leaving directory `/c/Users/Andre/Documents/NetBeansProjects/hello compiler'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/Andre/Documents/NetBeansProjects/hello compiler'
make.exe": *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 960ms)

有人知道如何解释这个输出吗?

谢谢 安德烈'

【问题讨论】:

  • 可以试试看这个:stackoverflow.com/q/9961041/10077
  • 尝试 cd "/c/Users/Andre/Documents/NetBeansProjects/hello compiler" 然后 g++ -c -g -MMD -MP -MF "build/Debug/MinGW-Windows/main.o.d" -o build/Debug/MinGW-Windows/main.o main.cpp 。它可能会给你更多的输出。
  • 另一件要尝试的事情是不要在文件名中添加空格。一些构建工具无法处理文件/目录名称中的空格。

标签: c++ netbeans mingw


【解决方案1】:

正如 M.M 所评论的,MinGw 不支持路径名中的空格。使用没有这样的路径应该可以。

【讨论】:

    猜你喜欢
    • 2016-11-25
    • 2017-09-15
    • 2021-08-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多