2013-07-19 27 views
0

我使用MinGW的編譯/製作/ etc文件,但每當我嘗試運行我的代碼,它吐出這回給我看:
Netbeans的建設問題的C++

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf 
make[1]: Entering directory `/c/Users/Geneva/workspace/C++ Through Game Programming' 
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/c___through_game_programming.exe 
make[2]: Entering directory `/c/Users/Geneva/workspace/C++ Through Game Programming' 
mkdir -p dist/Debug/MinGW-Windows 
g++  -o dist/Debug/MinGW-Windows/c___through_game_programming build/Debug/MinGW-Windows/diceroll.o build/Debug/MinGW-Windows/main.o 
build/Debug/MinGW-Windows/main.o: In function `main': 
C:\Users\Geneva\workspace\C++ Through Game Programming/main.cpp:35: multiple definition of `main' 
build/Debug/MinGW-Windows/diceroll.o:C:\Users\Geneva\workspace\C++ Through Game Programming/diceroll.cpp:16: first defined here 
collect2: ld returned 1 exit status 
make[2]: *** [dist/Debug/MinGW-Windows/c___through_game_programming.exe] Error 1 
make[2]: Leaving directory `/c/Users/Geneva/workspace/C++ Through Game Programming' 
make[1]: *** [.build-conf] Error 2 
make[1]: Leaving directory `/c/Users/Geneva/workspace/C++ Through Game Programming' 
make: *** [.build-impl] Error 2 


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

我有我的環境變量PATH設置正確,當我安裝了gbd我只是將其提取到正常的C:\ MinGW \ bin,這樣我就不必做C:\ MinGW \ msys \ 1.0 \ bin 任何人都可以幫忙嗎?如果我不能算出這個我要回去在Java

+4

您定義'main'兩次兩個主。 cpp和diceroll.cpp。 – greatwolf

+0

謝謝@greatwolf!我以爲我設立了其他的東西錯誤哈哈抱歉的noobness – Gcap

回答

0

編碼編譯器信息是明確的:您已經定義了多個main()功能