简体   繁体   English

我无法使Netbeans C ++正常工作,我在做什么错呢?

[英]I can't get Netbeans C++ to work, what am I doing wrong?

I recently downloaded Netbeans and I can't get the C++ component to work properly, when I attempt to compile on of the example programs I get this error: 我最近下载了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)

I am using the following build tools: 我正在使用以下构建工具:

Family: MinGW 家庭:MinGW

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

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

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

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

Assembler: C:\\Program Files (x86)\\MinGW\\bin\\as.exe 汇编器:C:\\ Program Files(x86)\\ MinGW \\ bin \\ as.exe

Make Command: C:\\Program Files (x86)\\MinGW\\bin\\msys\\1.0\\bin\\make.exe 生成命令:C:\\ Program Files(x86)\\ MinGW \\ bin \\ msys \\ 1.0 \\ bin \\ make.exe

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

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

I have had quite the same problem with NetBeans 7.3 fresh install on Windows 8, using Nuwen's MinGW "distro" and MSYS. 使用Nuwen的MinGW“ distro”和MSYS,在Windows 8上全新安装NetBeans 7.3时遇到了同样的问题。 I used MSYS make, which by the way was not automatically detected. 我使用了MSYS make,但是并没有自动检测到它。

The strange thing that happens is this: 发生的奇怪的事情是这样的:

"/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 “ / c / Users / * / Documents / NetBeansProjects / Welcome_1 /” C:/程序文件(x86)/MinGW/msys/1.0/bin/make.exe“” -f nbproject / Makefile-Debug.mk QMAKE = SUBPROJECTS = .build-conf

As we can see, path of current project and path to make executable are glued together, and so we get an error, obviously. 如我们所见,当前项目的路径和使可执行文件的路径被粘在一起,因此显然会出现错误。

What I did first is to compare my make executables' versions. 我首先要做的是比较make可执行文件的版本。 I had two make executables: 我有两个make可执行文件:

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

    GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; GNU Make 3.81版权所有(C)2006自由软件基金会,公司。 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 该程序为i686-pc-msys构建

  2. c:\\MinGW\\bin\\make.exe - 3.82 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. 为i686-pc-mingw32构建的GNU Make 3.82版权所有(C)2010自由软件基金会,公司。许可证GPLv3 +:GNU GPL版本3或更高版本http://gnu.org/licenses/gpl.html这是免费软件:您是自由更改和重新分发它。 There is NO WARRANTY, to the extent permitted by law. 在法律允许的范围内,没有任何担保。

I was pointing NB to the MSYS one, but when I changed that to the MinGW one - it all magically started to work fine. 我当时将NB指向MSYS,但是当我将其更改为MinGW时-一切都神奇地开始了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM