SDL einrichten mit Visual C++ Express
-
Hallo,
ich habe mir vor kurzem VCE geholt und wollte nun gerne ein bisschen was mit der SDL machen. Leider hab ich keinen schimmer wie ich die funktionierend einbinden kann.
Folgendes habe ich bis jetzt verzapft:1.) Da http://www.libsdl.org/download-1.2.php diese SDL-devel-1.2.9-VC6.zip Datei runtergeladen
2.) Entpackt
3.) VCE gestartet
4.) Unter Tools->Options->Projects and Solutions->VC++ Directories das Include und das lib verzeichnis von SDL angegeben
Wenn ich nun einen SDL Source Code kompilieren will, geht das nicht:
------ Build started: Project: Space Wars, Configuration: Debug Win32 ------ Linking... Framework.obj : error LNK2019: unresolved external symbol _SDL_GetKeyState referenced in function "public: bool __thiscall CFramework::Init(int,int,int,bool)" (?Init@CFramework@@QAE_NHHH_N@Z) Framework.obj : error LNK2019: unresolved external symbol _SDL_SetVideoMode referenced in function "public: bool __thiscall CFramework::Init(int,int,int,bool)" (?Init@CFramework@@QAE_NHHH_N@Z) Framework.obj : error LNK2019: unresolved external symbol _SDL_GetError referenced in function "public: bool __thiscall CFramework::Init(int,int,int,bool)" (?Init@CFramework@@QAE_NHHH_N@Z) Sprite.obj : error LNK2001: unresolved external symbol _SDL_GetError Framework.obj : error LNK2019: unresolved external symbol _SDL_Init referenced in function "public: bool __thiscall CFramework::Init(int,int,int,bool)" (?Init@CFramework@@QAE_NHHH_N@Z) Framework.obj : error LNK2019: unresolved external symbol _SDL_Quit referenced in function "public: void __thiscall CFramework::Quit(void)" (?Quit@CFramework@@QAEXXZ) Framework.obj : error LNK2019: unresolved external symbol _SDL_PumpEvents referenced in function "public: void __thiscall CFramework::Update(void)" (?Update@CFramework@@QAEXXZ) Framework.obj : error LNK2019: unresolved external symbol _SDL_FillRect referenced in function "public: void __thiscall CFramework::Clear(void)" (?Clear@CFramework@@QAEXXZ) Framework.obj : error LNK2019: unresolved external symbol _SDL_MapRGB referenced in function "public: void __thiscall CFramework::Clear(void)" (?Clear@CFramework@@QAEXXZ) Sprite.obj : error LNK2001: unresolved external symbol _SDL_MapRGB Framework.obj : error LNK2019: unresolved external symbol _SDL_Flip referenced in function "public: void __thiscall CFramework::Flip(void)" (?Flip@CFramework@@QAEXXZ) Game.obj : error LNK2019: unresolved external symbol _SDL_PollEvent referenced in function "private: void __thiscall CGame::ProcessEvents(void)" (?ProcessEvents@CGame@@AAEXXZ) Sprite.obj : error LNK2019: unresolved external symbol _SDL_FreeSurface referenced in function "public: __thiscall CSprite::~CSprite(void)" (??1CSprite@@QAE@XZ) Sprite.obj : error LNK2019: unresolved external symbol _SDL_LoadBMP_RW referenced in function "public: void __thiscall CSprite::Load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?Load@CSprite@@QAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) Sprite.obj : error LNK2019: unresolved external symbol _SDL_RWFromFile referenced in function "public: void __thiscall CSprite::Load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?Load@CSprite@@QAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) Sprite.obj : error LNK2019: unresolved external symbol _SDL_SetColorKey referenced in function "public: void __thiscall CSprite::SetColorKey(int,int,int)" (?SetColorKey@CSprite@@QAEXHHH@Z) Sprite.obj : error LNK2019: unresolved external symbol _SDL_UpperBlit referenced in function "public: void __thiscall CSprite::Render(void)" (?Render@CSprite@@QAEXXZ) Timer.obj : error LNK2019: unresolved external symbol _SDL_GetTicks referenced in function "public: __thiscall CTimer::CTimer(void)" (??0CTimer@@QAE@XZ) MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup D:\Programmierung\Meine Projekte\Space Wars\Debug\Space Wars.exe : fatal error LNK1120: 17 unresolved externals Build log was saved at "file://d:\Programmierung\Meine Projekte\Space Wars\Debug\BuildLog.htm" Space Wars - 20 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Da der Compiler sich praktisch über jeden SDL Befehl aufregt, gehe ich davon aus, dass ich bei der Einbindung der SDL etwas falsch bzw. etwas vergessen habe.
Wer kann mir sagen was??GreetZ
-
Hast die einzelnen Librarys auch hinzugefügt? Es reicht nicht nur den Pfad anzugeben, man muss auch namentlich nennen welche ein-
gebunden werden sollen. Das musst auch bei den Project Settings machen (irgendwo bei den Linker-Einstellungen müsste das sein).