我一直在尝试遵循本指南在C ++中编写一个程序,该程序允许我创建一个应用程序窗口,但是我遇到了一个问题,每当我在上面链接的页面上提供的示例代码上使用MINGW-W64运行构建任务时,我会继续运行陷入相同的错误。
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../libmingw32.a(main.o):(.text.startup+0xc0): undefined reference to 'WinMain@16'
collect2.exe: error: ld returned 1 exit status
该位的重要部分是未定义的引用“ Winmain@16'
”。显然,由于我尝试过的示例代码使用了wwinmain而不是winmain,所以mingw找不到任何入口点?因此,这意味着如果我想运行此代码,我不能使用mingw。那我该怎么办?哪种编译器实际上可以用于编译WWINMAIN?
I've been attempting to follow this guide here for writing a program in C++ that allows me to create an application window, however I ran into an issue where whenever I used Run Build Task with MinGW-w64 on the example code provided on the page linked above, I keep running into this same error.
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../libmingw32.a(main.o):(.text.startup+0xc0): undefined reference to 'WinMain@16'
collect2.exe: error: ld returned 1 exit status
The important part of that bit is the undefined reference to 'WinMain@16'
at the end. Apparently because the sample code I tried uses wWinMain instead of WinMain, MinGW can't find any entry point? So this would mean I can't use MinGW if I want to run this code. So what do I do instead? What compiler would actually work for compiling wWinMain?
发布评论