Horde3D
http://horde3d.org/forums/

Static linking
http://horde3d.org/forums/viewtopic.php?f=1&t=1889
Page 1 of 1

Author:  mikel [ 12.06.2013, 20:14 ]
Post subject:  Static linking

Im trying to link (newest from svn)horde3d static lib, using Visual Studio express 2012, but cant get it to work.

First I changed Horde3D Engine and Horde3D Utils -projects' "Configuration type" from "Dynamic Library (.dll)" to "Static library (.lib)".

Then I added
#define DLL to beginning of the Horde3D.h
and
#define DLLEXP to beginning of the uPlatform.h .

Finally commented out DllMain() functions at the end of the egMain.cpp and main.cpp .

But get
Quote:
Error 3 error LNK2001: unresolved external symbol "void __cdecl h3dShowOverlays(float const *,int,float,float,float,float,int,int)" (?h3dShowOverlays@@YAXPBMHMMMMHH@Z)

etc LNK 2001 unresolved errors.

What Im missing?

Author:  299299 [ 17.06.2013, 07:26 ]
Post subject:  Re: Static linking

DLLEXP void h3dShowOverlays( const float *verts, int vertCount, float colR, float colG,
float colB, float colA, uint32 materialRes, int flags )

should change to

DLLEXP void h3dShowOverlays( const float *verts, int vertCount, float colR, float colG,
float colB, float colA, int materialRes, int flags );


because in horde3d.h header file the function is declared like this:

DLL void h3dShowOverlays( const float *verts, int vertCount, float colR, float colG, float colB,
float colA, H3DRes materialRes, int flags );

here H3DRes is int, not uint32

Author:  attila [ 17.06.2013, 08:05 ]
Post subject:  Re: Static linking

299299 wrote:
DLLEXP void h3dShowOverlays( const float *verts, int vertCount, float colR, float colG,
float colB, float colA, uint32 materialRes, int flags )

should change to

DLLEXP void h3dShowOverlays( const float *verts, int vertCount, float colR, float colG,
float colB, float colA, int materialRes, int flags );


or change it to this

DLLEXP void h3dShowOverlays( const float *verts, int vertCount, float colR, float colG,
float colB, float colA, ResHandle materialRes, int flags );

as other functions use ResHandle when Horde3D.h uses H3DRes.

Author:  mikel [ 17.06.2013, 15:51 ]
Post subject:  Re: Static linking

Ah, got it. Replaced couple of other params to int too, and got working Sample_Chicago.exe which works without dll.

Functions which didnt compile (but works with int):

void h3dShowOverlays( const float *verts, int vertCount, float colR, float colG,
float colB, float colA, int materialRes, int flags );

bool h3dSetOption( int param, float value );

float h3dGetStat( int param, bool reset );


Thanks.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/