Hallo ich bins nochmal mit meiner Engine.
Ich wollte eine Klasse schreibe, die man als Basisklasse für ein Objekt (Fahrzeug, etc) benutzt.
Compilerfehler sind keine da, nur Linkerfehler (3x LNK2019) die fehler gehen alle von der Entityklasse aus (die Basisklasse).
Was mache ich falsch, lib der Engine ist gelinkt.
Entity.h
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#ifndef WASDENTITY_H_
#define WASDENTITY_H_
#include <string>
#include "..\src\wasdObject.h"
#include "..\src\Declarations.h"
namespace wasd
{
class _declspec(dllimport) wasdEntity
{
public:
wasdEntity(std::string path);
virtual ~wasdEntity();
private:
wasdObject* obj;
};
}
#endif
|
Entity.cpp
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
#include "..\shared\wasdEntity.h"
using namespace wasd;
using namespace std;
wasdEntity::wasdEntity(std::string path)
{
obj = new wasdObject(path);
}
wasdEntity::~wasdEntity()
{
delete obj;
}
|
wasdObject hat bisher noch keine funktionalität, es reicht den String erstmal nur weiter an das wasdModel.
wasdModel läd dann die Datei (im moment nur Testdatei).
model.h
|
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
|
#ifndef WASDMODEL_H_
#define WASDMODEL_H_
#include <vector>
#include "Structs.h"
namespace wasd
{
class wasdModel
{
public:
wasdModel(std::string path);
~wasdModel();
std::vector<Vertex> getVertices();
private:
std::vector<Vertex> vertices;
void loadVertices(std::string path);
std::string getAppPath();
};
}
#endif
|
model.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
#include "wasdModel.h"
#include <fstream>
#include <iostream>
#include <Windows.h>
using namespace wasd;
using namespace std;
wasdModel::wasdModel(string path)
{
loadVertices(path);
}
wasdModel::~wasdModel()
{
}
vector<Vertex> wasdModel::getVertices()
{
return vertices;
}
void wasdModel::loadVertices(string path)
{
vector<string> lines;
ifstream stream;
string tmp = getAppPath();
string b = tmp + path;
stream.open(b);
string zeile = "";
int i = 0;
while(getline(stream, zeile, '\0'))
{
lines[i] = zeile;
i++;
}
cout<<lines[0];
}
string wasdModel::getAppPath()
{
wchar_t directory[256];
_wgetcwd(directory, 255);
char b[256];
char DefChar = ' ';
WideCharToMultiByte(CP_ACP,0,directory,-1, b,256,&DefChar, NULL);
string ret(b);
return ret;
}
|
Fehlermeldung:
|
Quellcode
|
1
2
3
4
5
6
7
8
9
|
Fehler 126 error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: virtual __thiscall wasd::wasdEntity::~wasdEntity(void)" (__imp_??1wasdEntity@wasd@@UAE@XZ)" in Funktion ""public: virtual __thiscall testModel::~testModel(void)" (??1testModel@@UAE@XZ)". D:\Benutzer\Jan\documents\visual studio 2012\Projects\wasdEngine2.0\testGame\testModel.obj testGame
Fehler 125 error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: __thiscall wasd::wasdEntity::wasdEntity(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (__imp_??0wasdEntity@wasd@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)" in Funktion ""public: __thiscall testModel::testModel(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0testModel@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)". D:\Benutzer\Jan\documents\visual studio 2012\Projects\wasdEngine2.0\testGame\testModel.obj testGame
Fehler 123 error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) const wasd::wasdEntity::`vftable'" (__imp_??_7wasdEntity@wasd@@6B@)" in Funktion ""public: __thiscall wasd::wasdEntity::wasdEntity(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0wasdEntity@wasd@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)". D:\Benutzer\Jan\documents\visual studio 2012\Projects\wasdEngine2.0\wasdEngine2.0\wasdEntity.obj wasdEngine2.0
Fehler 127 error LNK1120: 2 nicht aufgelöste Externe D:\Benutzer\Jan\documents\visual studio 2012\Projects\wasdEngine2.0\Debug\testGame.exe 1 1 testGame
Fehler 124 error LNK1120: 1 nicht aufgelöste Externe D:\Benutzer\Jan\documents\visual studio 2012\Projects\wasdEngine2.0\wasdEngine2.0\Lib\wasdEngine.dll wasdEngine2.0
|