2013-10-18 94 views
0

我已經安裝了msys,並在系統中添加bin的路徑,但仍然有一些錯誤。編譯期間的netbean錯誤

"/C/msys/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf 
make.exe[1]: Entering directory `/d/NetBeansProjekty/CppApplication_2' 
"/C/msys/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/cppapplication_2.exe 
make.exe[2]: Entering directory `/d/NetBeansProjekty/CppApplication_2' 
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]: g++: Command not found 
make.exe[2]: *** [build/Debug/MinGW-Windows/main.o] Error 127 
make.exe[2]: Leaving directory `/d/NetBeansProjekty/CppApplication_2' 
make.exe[1]: *** [.build-conf] Error 2 
make.exe[1]: Leaving directory `/d/NetBeansProjekty/CppApplication_2' 
make.exe": *** [.build-impl] Error 2 


BUILD FAILED (exit value 2, total time: 852ms) 

你能告訴我什麼問題嗎?

現在我加入MinGW的路徑,而且也彈出新derror

"/C/msys/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= 
    SUBPROJECTS= .build-conf make.exe[1]: Entering directory 
    `/d/NetBeansProjekty/CppApplication_2' "/C/msys/bin/make.exe" -f 
    nbproject/Makefile-Debug.mk 
    dist/Debug/MinGW-Windows/cppapplication_2.exe make.exe[2]: Entering 
    directory `/d/NetBeansProjekty/CppApplication_2' mkdir -p 
    dist/Debug/MinGW-Windows g++ -o 
    dist/Debug/MinGW-Windows/cppapplication_2 
    build/Debug/MinGW-Windows/main.o build/Debug/MinGW-Windows/newmain.o 
    build/Debug/MinGW-Windows/newmain.o: In function `main': 
    D:\NetBeansProjekty\CppApplication_2/newmain.cpp:5: multiple 
    definition of `main' 
    build/Debug/MinGW-Windows/main.o:D:\NetBeansProjekty\CppApplication_2/main.cpp:15: 
    first defined here collect2.exe: error: ld returned 1 exit status 
    make.exe[2]: *** [dist/Debug/MinGW-Windows/cppapplication_2.exe] 
    Error 1 make.exe[2]: Leaving directory 
    `/d/NetBeansProjekty/CppApplication_2' make.exe[1]: *** [.build-conf] 
    Error 2 make.exe[1]: Leaving directory 
    `/d/NetBeansProjekty/CppApplication_2' make.exe": *** [.build-impl] 
    Error 2 

+0

仔細看,你會看到「g ++:Command not found」。那就是問題所在。 g ++需要在你的路上。 –

+1

最後,重寫了重啓程序及其工作路徑,謝謝! – franzp

+0

請將您的解決方案作爲答案發布,並*接受*它,以便其他人看到它已解決。 – ollo

回答

0

我改寫了路徑,並重新啓動程序和它的工作。