How to build irrlicht as a static library?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
rnodal
Posts: 5
Joined: Sun Feb 04, 2007 10:25 pm

How to build irrlicht as a static library?

Post by rnodal »

Hello all:

Is it possible to build irrlicht as a static lib? If so then how?
I have tried to do this since the source code is given but I have failed. Thanks a lot for your time.


-r
madoc
Posts: 32
Joined: Fri Feb 11, 2005 10:43 am

Post by madoc »

You might get more help/informed opinions if you gave some information.

- What OS
- What compiler/version of compiler?
- Which version of Irrlicht?
Robert Y.
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Post by Robert Y. »

If so then how?
You can search the forum for the term __declspec(dllexport)
rnodal
Posts: 5
Joined: Sun Feb 04, 2007 10:25 pm

Post by rnodal »

Sorry for the lack of information. My bad. Robert thanks for pointing that out I knew it had to do with that because the only problem I was having was the function "createdevice" which uses the whole dll stuff. Thanks a lot.


-r
drac_gd
Posts: 132
Joined: Sun Apr 09, 2006 8:43 pm

Post by drac_gd »

In IrrCompileConfig.h find the section for dll exports are defined and replace with

Code: Select all

// Windows Only DLL export definition
#if defined(_IRR_WINDOWS_) && !defined(_IRR_STATIC_LIB_)
#	ifdef IRRLICHT_EXPORTS
#		define IRRLICHT_API __declspec(dllexport)
#	else
#		define IRRLICHT_API __declspec(dllimport)
#	endif // IRRLICHT_EXPORT
#else
#	define IRRLICHT_API 
#endif // _IRR_WINDOWS_
then in your preprocessor defines define _IRR_STATIC_LIB_
where you do this depends on your compiler.. In vc its in your project properties in C/C++ Preprocessor..

then change your project to be a static lib instead of dll

something like this used to be in irrlicht but has been removed
rnodal
Posts: 5
Joined: Sun Feb 04, 2007 10:25 pm

Post by rnodal »

thanks all.
Post Reply