针对C++的Netbeans构建问题

Netbeans Building Issues for C++

本文关键字:构建 问题 Netbeans C++ 针对      更新时间:2023-10-16

我使用的是MinGW complexer/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:UsersGenevaworkspaceC++ Through Game Programming/main.cpp:35: multiple definition of `main'
build/Debug/MinGW-Windows/diceroll.o:C:UsersGenevaworkspaceC++ 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 中进行编码

编译器消息很清楚:您定义了多个main()函数