以下是完整的错误代码:
------ Build started: Project: PongGame, Configuration: Debug Win32 ------
main.cpp
main.obj : error LNK2019: unresolved external symbol _SDL_Init referenced in function "int_cdecl SDL_main(int,char * * * const)" (?SDL_main@@YAHHQAPAPAD@Z)
main.obj : error LNK2019: unresolved external symbol _SDL_Quit referenced in function "int __cdecl SDL_main(int,char * * * const)" (?SDL_main@@YAHHQAPAPAD@Z)
MSVCRT.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
C:\Users\Robbie\Documents\Visual Studio 2013\Projects\PongGame\Debug\PongGame.exe : fatal error LNK1120: 3 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
这是我的主要内容:
#include "SDL.h"
#include "SDL_ttf.h"
int main( int argc, char* args[] ) {
// Start SDL
SDL_Init( SDL_INIT_EVERYTHING );
// Quit SDL
SDL_Quit();
return 0;
}
所以你可以看到我的主要是非常基本的,我还没有真正开始编码,但这个错误非常烦人! 我将子系统设置为控制台,这是我的其他依赖项:
SDL2.lib
SDL2main.lib
SDL2_ttf.lib