gpt4 book ai didi

c++ - NetBeans C++构建问题

转载 作者:行者123 更新时间:2023-12-02 11:05:16 25 4
gpt4 key购买 nike

我正在使用MinGW complier/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编码中

最佳答案

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

关于c++ - NetBeans C++构建问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17739644/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com