c++ - 我无法让 Netbeans C++ 工作,我做错了什么?

标签 c++ netbeans

我最近下载了 Netbeans,但我无法让 C++ 组件正常工作,当我尝试编译示例程序时出现此错误:

"/c/Users/*/Documents/NetBeansProjects/Welcome_1/"C:/Program Files (x86)/MinGW/msys/1.0/bin/make.exe"" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf

/bin/sh: -c: line 0: syntax error near unexpected token `('

/bin/sh: -c: line 0 `"/c/Users/*/Documents/NetBeansProjects/Welcome_1/"C:/Program Files (x86)/MinGW/msys/1.0/bin/make.exe"" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf'
make.exe": *** [.build-impl] Error 2


BUILD FAILED (exit value 2, total time: 3s)

我正在使用以下构建工具:

家族:MinGW

基本目录:C:\Program Files (x86)\MinGW\bin

C 编译器:C:\Program Files (x86)\MinGW\bin\gcc.exe

C++ 编译器:C:\Program Files (x86)\MinGW\bin\g++.exe

Fortran 编译器:C:\Program Files (x86)\MinGW\bin\gfortran.exe

汇编程序:C:\Program Files (x86)\MinGW\bin\as.exe

制作命令:C:\Program Files (x86)\MinGW\bin\msys\1.0\bin\make.exe

或者,我使用了 C:\Program Files (x86)\Msys\1.0\bin\make.exe

调试器命令:C:\Program Files (x86)\MinGW\bin\gdb.exe

最佳答案

我在 Windows 8 上使用 Nuwen 的 MinGW“发行版”和 MSYS 全新安装 NetBeans 7.3 时遇到了完全相同的问题。我使用了 MSYS make,顺便说一句,它没有被自动检测到。

奇怪的是:

"/c/Users/*/Documents/NetBeansProjects/Welcome_1/"C:/Program Files (x86)/MinGW/msys/1.0/bin/make.exe"" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf

正如我们所见,当前项目的路径和生成可执行文件的路径粘合在一起,因此我们显然会出错。

我首先做的是比较我的 make 可执行文件的版本。我有两个 make 可执行文件:

  1. c:\MSYS\bin\make.exe - 3.81

    GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    This program built for i686-pc-msys

  2. c:\MinGW\bin\make.exe - 3.82

    GNU Make 3.82 Built for i686-pc-mingw32 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

我将 NB 指向 MSYS,但当我将其更改为 MinGW 时 - 它神奇地开始正常工作。

关于c++ - 我无法让 Netbeans C++ 工作,我做错了什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9959679/

相关文章:

java - 为什么时间序列集合图表中的数据显示不正确?

java - 为什么 StdDraw 无论如何都不会被识别?

c++ - QListView更新-不触发更新

c++ - Windows 上的 Qt QMYSQL "Driver not loaded"

c++ - 如何使用 Visual Studio 处理大型非 VS 代码库?

NetBeans 大括号自动关闭

ruby-on-rails - Netbeans 上的 Rails : Uncaught exception: no such file to load -- script/server or script/console

java - 如何写入具有特定字符集的 StyledDocument?

c++ - 用灵气解析C风格的关系运算符

c++ - 如何检测 Linux 中的文件访问?