Salut à tous
J'epprouve quelques problemes à mettre sous forme de dll une classe que j'ai crée. Cette classe a ete developpé en pure interface.
Voila le code(je met que les .h vu que le code dans les .cpp est bon)
EGESprite.h
EGESprite_Private.h
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79 #include <GL/glut.h> #include <string> #include "EGEPOINT3D.h" #include "EGEColor4.h" #include "EGEColor3.h" #include "TGA/TGA.h" #ifndef _EGESPRITE #define _EGESPRITE #define EGE_LEFT_DOWN_CORNER_COLLIDE 1 #define EGE_LEFT_UP_CORNER_COLLIDE 2 #define EGE_RIGHT_UP_CORNER_COLLIDE 3 #define EGE_RIGHT_DOWN_CORNER_COLLIDE 4 #define EGE_LEFT_COLLIDE 5 #define EGE_UP_COLLIDE 6 #define EGE_RIGHT_COLLIDE 7 #define EGE_DOWN_COLLIDE 8 #define EGE_IS_COLLIDE 9 #define EGE_IS_NOT_COLLIDE 0 class EGESPRITE { protected: EGESPRITE(); public: virtual ~EGESPRITE(); static EGESPRITE* Create(char *Filename=NULL); virtual void Draw(int screenx,int screeny)=0; virtual void Draw(EGEPOINT3D screenposition)=0; virtual void DrawCenterX(int screeny)=0; virtual void DrawCenterY(int screenx)=0; virtual void DrawCenter(void)=0; virtual void DrawCenterAround(int screenx,int screeny)=0; virtual int GetSizeX(void)=0; virtual int GetSizeY(void)=0; virtual void SetSizeX(int s)=0; virtual void SetSizeY(int s)=0; virtual const char* GetFilename(void)=0; virtual int IsCollideWith(EGESPRITE *Sprite)=0; virtual EGEPOINT3D GetPosition(void)=0; virtual void SetPosition(EGEPOINT3D Pos)=0; virtual int GetPositionX(void)=0; virtual void SetPositionX(int screenx)=0; virtual int GetPositionY(void)=0; virtual void SetPositionY(int screeny)=0; virtual int GetPositionZ(void)=0; virtual void SetPositionZ(int screenz)=0; virtual GLuint GetId(void)=0; virtual void SetColor3(int r,int g,int b)=0; virtual void SetColor3(EGECOLOR3)=0; virtual EGECOLOR3 GetColor3(void)=0; virtual void SetColor4(int r,int g,int b,int a)=0; virtual void SetColor4(EGECOLOR4 c)=0; virtual EGECOLOR4 GetColor4(void)=0; virtual void SetOpacity(int alpha)=0; virtual int GetOpacity(void)=0; }; #endif
DLL.def
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76 #include "EGESprite.h" #include <string> using namespace std; #ifndef _EGESPRITE_PRIVATE #define _EGESPRITE_PRIVATE class EGESPRITE_PRIVATE: public EGESPRITE { private: EGEPOINT3D Position; EGEPOINT3D Size; EGECOLOR4 Color; GLuint Id; //gl_texture_t *Texture; string Filename; public: explicit EGESPRITE_PRIVATE(const char *Filename=NULL); ~EGESPRITE_PRIVATE(); void Draw(int screenx,int screeny); void Draw(EGEPOINT3D screenposition); void DrawCenterX(int screeny); void DrawCenterY(int screenx); void DrawCenter(void); void DrawCenterAround(int screenx,int screeny); int GetSizeX(void); int GetSizeY(void); void SetSizeX(int s); void SetSizeY(int s); const char* GetFilename(void); int IsCollideWith(EGESPRITE *Sprite); EGEPOINT3D GetPosition(void); void SetPosition(EGEPOINT3D Pos); int GetPositionX(void); void SetPositionX(int screenx); int GetPositionY(void); void SetPositionY(int screeny); GLuint GetId(void); void SetColor3(int r,int g,int b); void SetColor3(EGECOLOR3); EGECOLOR3 GetColor3(void); void SetColor4(int r,int g,int b,int a); void SetColor4(EGECOLOR4 c); EGECOLOR4 GetColor4(void); void SetOpacity(int alpha); int GetOpacity(void); int GetPositionZ(void); void SetPositionZ(int screenz); }; #endif
La compilation se passe sans probleme mais au link j'obtient les erreurs suivantes:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 EXPORTS Create Draw Draw DrawCenterX DrawCenterY DrawCenter DrawCenterAround GetSizeX GetSizeY SetSizeX SetSizeY GetFilename IsCollideWith GetPosition SetPosition GetPositionX SetPositionX GetPositionY SetPositionY GetPositionZ SetPositionZ GetId SetColor3 SetColor3 GetColor3 SetColor4 SetColor4 GetColor4 SetOpacity GetOpacity
LL.def : warning LNK4022: cannot find unique match for symbol "Draw"
.\DLL.def : warning LNK4002: "public: virtual void __thiscall EGESPRITE_PRIVATE:raw(int,int)" (?Draw@EGESPRITE_PRIVATE@@UAEXHH@Z) defined in .\Debug\EGESprite_Private.obj
.\DLL.def : warning LNK4002: "public: virtual void __thiscall EGESPRITE_PRIVATE:raw(class EGEPOINT3D)" (?Draw@EGESPRITE_PRIVATE@@UAEXVEGEPOINT3D@@@Z) defined in .\Debug\EGESprite_Private.obj
.\DLL.def : warning LNK4022: cannot find unique match for symbol "SetColor3"
.\DLL.def : warning LNK4002: "public: virtual void __thiscall EGESPRITE_PRIVATE::SetColor3(int,int,int)" (?SetColor3@EGESPRITE_PRIVATE@@UAEXHHH@Z) defined in .\Debug\EGESprite_Private.obj
.\DLL.def : warning LNK4002: "public: virtual void __thiscall EGESPRITE_PRIVATE::SetColor3(class EGECOLOR3)" (?SetColor3@EGESPRITE_PRIVATE@@UAEXVEGECOLOR3@@@Z) defined in .\Debug\EGESprite_Private.obj
.\DLL.def : warning LNK4022: cannot find unique match for symbol "SetColor4"
.\DLL.def : warning LNK4002: "public: virtual void __thiscall EGESPRITE_PRIVATE::SetColor4(int,int,int,int)" (?SetColor4@EGESPRITE_PRIVATE@@UAEXHHHH@Z) defined in .\Debug\EGESprite_Private.obj
.\DLL.def : warning LNK4002: "public: virtual void __thiscall EGESPRITE_PRIVATE::SetColor4(class EGECOLOR4)" (?SetColor4@EGESPRITE_PRIVATE@@UAEXVEGECOLOR4@@@Z) defined in .\Debug\EGESprite_Private.obj
LINK : fatal error LNK1152: cannot resolve one or more undecorated symbols
LINK : fatal error LNK1141: failure during build of exports file
Ca doit etre tout bete mais c'est la premier fois que je fais une dll etj'ai l'impression qu'il aime les surcharges de fonctions.
Merci
Partager