0

MinGW コンパイラ/make/etc ファイルを使用していますが、コードを実行しようとすると、次のようなメッセージが返されます。

"/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

1 に答える 1

0

コンパイラ メッセージは明確です: You have defined multiple main()functions

于 2013-07-19T07:59:12.233 に答える