000
01.04.2011, 12:53 Uhr
banshee
|
Hi,
ich finde den Fehler einfach nicht:
error LNK2001: unresolved external symbol "public: static class GlobalSettings * __cdecl GlobalSettings::GetInstance(void)" (?GetInstance@GlobalSettings@@SAPAV1@XZ)
App.cpp
C++: |
#include <windows.h> #include "..\GlobalSettings\GlobalSettings.h"
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { GlobalSettings::GetInstance();//->SetTextureFilePath("..\\Data\\"); return 0; }
int main(int argc, char* argv[]) { return WinMain(0,0,0,0); }
|
GlobalSettings.h
C++: |
#pragma once #include "..\system\singleton.h"
class GlobalSettings { public: char *textureFilePath;
GlobalSettings(void); ~GlobalSettings(void);
void SetTextureFilePath(char *path);
SINGLETON_FACTORY_H (GlobalSettings) };
|
GlobalSettings.cpp
C++: |
#include "./GlobalSettings.h"
SINGLETON_FACTORY_CPP (GlobalSettings)
GlobalSettings::GlobalSettings(void) { textureFilePath = ""; }
GlobalSettings::~GlobalSettings(void) { }
void GlobalSettings::SetTextureFilePath(char *path) { textureFilePath = path; }
|
singleton.h
C++: |
#if !defined(SINGLETON_FACTORY_H) #define SINGLETON_FACTORY_H(a) static a* singleton; static a* GetInstance(); #endif
#if !defined(SINGLETON_FACTORY_CPP) #define SINGLETON_FACTORY_CPP(a) a* a::singleton = 0; a* a::GetInstance() { if (!singleton) singleton = new a(); return singleton; } #endif
|
Was läuft da falsch? |