更新时间:2023-02-19 20:47:56
在Windows上,当您包括 SDL.h
, main
被重新定义为 SDL_main
调用 WinMain
(非控制台Windows应用程序的真正入口点),做一些初始化,最后调用你的主要代码。它有一个签名 argc
和 argv
,你几乎需要遵循它,所以 int main()
将无法工作。
This is SDL thing. On Windows, when you include SDL.h
,main
is redefined to SDL_main
which calls WinMain
(the real entry point in non-console Windows apps), does some initialization and finally calls your main code. It has a signature with argc
and argv
and you're pretty much required to follow it, so int main()
won't work.