报错 c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../libmingw32.a(main.o):(.text.startup+0xb0): undefined reference to `WinMain@16' collect2.exe: error: ld returned 1 exit status mingw32-make.exe[3]: *** [qh.exe] Error 1 mingw32-make.exe[2]: *** [CMakeFiles/qh.dir/all] Error 2 mingw32-make.exe[1]: *** [CMakeFiles/qh.dir/rule] Error 2 mingw32-make.exe: *** [qh] Error 2 CMakeFiles\qh.dir\build.make:104: recipe for target 'qh.exe' failed CMakeFiles\Makefile2:122: recipe for target 'CMakeFiles/qh.dir/all' failed CMakeFiles\Makefile2:129: recipe for target 'CMakeFiles/qh.dir/rule' failed Makefile:149: recipe for target 'qh' failed‘
时间: 2023-07-31 21:11:20 浏览: 536
mingw32-make.exe
5星 · 资源好评率100%
这个错误是由于缺少WinMain函数引起的,它是Windows程序的入口点。你可以尝试在你的代码中添加WinMain函数定义,或者使用main函数代替WinMain函数。如果你想要创建一个Windows GUI程序,你需要使用WinMain函数而不是main函数。另外,你也可以检查你的编译器是否正确配置。
阅读全文