我安装了netbeans来用C编写代码。但是使用Mingw编译器有问题。它工作得很好,直到我尝试运行该项目。 首先,它在尝试运行 cc1.exe 时无法找到它。当我找到它并手动复制到同一文件夹时,又出现了另一个错误。
"C:/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
C:\bin\make.exe[1]: Entering directory `D:/1/2/Skola/IZP/programovani/projekt4netbeans/CppApplication_6'
"C:/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW_1-Windows/cppapplication_6.exe
C:\bin\make.exe[2]: Entering directory `D:/1/2/Skola/IZP/programovani/projekt4netbeans/CppApplication_6'
mkdir -p build/Debug/MinGW_1-Windows
rm -f build/Debug/MinGW_1-Windows/main.o.d
gcc.exe -c -g -MMD -MP -MF build/Debug/MinGW_1-Windows/main.o.d -o build/Debug/MinGW_1-Windows/main.o main.c
cc1: error: command line option '-lang-c' is valid for the driver but not for C
C:\bin\make.exe[2]: *** [build/Debug/MinGW_1-Windows/main.o] Error 1
C:\bin\make.exe[2]: Leaving directory `D:/1/2/Skola/IZP/programovani/projekt4netbeans/CppApplication_6'
C:\bin\make.exe[1]: *** [.build-conf] Error 2
C:\bin\make.exe[1]: Leaving directory `D:/1/2/Skola/IZP/programovani/projekt4netbeans/CppApplication_6'
C:\bin\make.exe: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 2s)
如果有人可以帮助我......谢谢:)
最佳答案
确保您拥有最新版本的 Netbeans 和 MinGw,并且安装正确 ( Configuring the NetBeans IDE for C/C++/Fortran )。
在 mingw 上,您不应该使用 make
来自mingw/bin
,但是来自 msys
的那个( <mingw>/msys/1.0/bin/make.exe
)
关于NETBEANS、cc1下的C开发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8474101/