int main(int argc, char* argv)
^not quite right...
見the docs爲SDL2的魔法main
宏:
/**
* \file SDL_main.h
*
* The application's main() function must be called with C linkage,
* and should be declared like this:
* \code
* #ifdef __cplusplus
* extern "C"
* #endif
* int main(int argc, char *argv[])
* {
* }
* \endcode
*/
#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE)
#define main SDL_main
#endif
/**
* The prototype for the application's main() function
*/
extern C_LINKAGE int SDL_main(int argc, char *argv[]);
所以,你想改變
int main(int argc, char** argv)
或
int main(int argc, char* argv[])
既然你從你可能還需要選擇一個/SUBSYSTEM
: usually CONSOLE
or WINDOWS
奇怪的空項目模板開始。 LNK1561通常意味着'main'丟失。確保您選擇了一個應用程序項目,而不是將構建DLL的項目類型。 – user4581301
您可以編輯您正在使用的Windows,Visual Studio和SDL版本?您是否抓住了[預構建的SDL開發二進制文件](https://www.libsdl.org/download-2.0.php),還是您自己創建了?你在爲32位或64位構建你的程序嗎? – genpfault
Visual Studio Express 2017,Windows 10,Windows'SDL-devel-2.05-VC.zip'這有幫助嗎? –