Hallo Leute,
ich möchte mein erstes eigenes Spiel in der SDL programmieren. Ich habe den Anfang gesetzt und schon habe ich 8 Fehlermeldungen
.
Ich habe auch schon versucht, alles neu Einzustellen (SDL Einbinden, ...), aber ohne Erfolg. Hier ist der Quellcode:
Main.cpp
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#include <SDL.h>
#include "CGame.hpp"
using namespace std;
// Hauptprogramm
//
int main (int argc, char *argv[])
{
// Instanz erstellen
CGame Game;
// Initialisieren
Game.Init ();
// Beenden
Game.Close ();
return 0;
}
|
CGame.hpp
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
|
using namespace std;
class CGame
{
public:
void Init ();
void Close ();
private:
bool m_bIsRunning;
};
|
CGame.cpp
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#include <SDL.h>
#include "CGame.hpp"
using namespace std;
// Init ()
//
// Aufgabe: Initialisiert alles
//
void Init ()
{
// SDL Initialisieren
SDL_Init (SDL_INIT_EVERYTHING);
// Pointer auf den Bildschirm
SDL_Surface* screen = NULL;
// Fenster erstellen
screen = SDL_SetVideoMode ( 1280, 720, 32, SDL_SWSURFACE);
SDL_WM_SetCaption ("Shuttel-Experte", NULL);
}
// Close ()
//
// Aufgabe: Schließt das Spiel
//
void Close ()
{
SDL_Quit ();
}
|
Hier die Fehlermeldungen:
error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_SDL_WM_SetCaption" in Funktion ""void __cdecl Init(void)" (?Init@@YAXXZ)".
error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_SDL_SetVideoMode" in Funktion ""void __cdecl Init(void)" (?Init@@YAXXZ)".
error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_SDL_Init" in Funktion ""void __cdecl Init(void)" (?Init@@YAXXZ)".
error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_SDL_Init" in Funktion ""void __cdecl Init(void)" (?Init@@YAXXZ)"
error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: void __thiscall CGame::Init(void)" (?Init@CGame@@QAEXXZ)" in Funktion "_SDL_main".
error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: void __thiscall CGame::Close(void)" (?Close@CGame@@QAEXXZ)" in Funktion "_SDL_main".
error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_main" in Funktion "___tmainCRTStartup".
error LNK1120: 7 nicht aufgelöste Externe
Ich bin immer offen für Verbesserungsvorschläge und Kritik. Danke im Voraus