Cross compiling Irrlich lib for windows from Linux?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
z4rd0z
Posts: 11
Joined: Sat Jan 12, 2008 9:11 am

Cross compiling Irrlich lib for windows from Linux?

Post by z4rd0z »

I know this is not supported, I am just wondering if someone already did this and can help me.

I'm developing on Linux and I use to cross-build Windows apps/libs from Linux using the mingw building tool chain. It's pretty easy to use IrrLicht lib in such apps because the irrlicht SDK provides pre-compiled .a and .dll files for Windows/gcc.

Unfortunately, I need to apply a patch to IrrLicht 1.5 and so, I need to rebuild the library. This is obviously ok for the Linux side, but I would like to also cross-build the Windows lib (either the static .a or the dynamic .a + .dll for gcc). I created a new Makefile to do so. I am able to generate a static win32 lib but some symbols are missing and I cannot link it with my code.

If someone has the same issue, please tell me! In the mean time, I will ask to a Windows user to build the patched lib for me :)

Here is a link to the Linux/mingw Makefile: http://sites.google.com/site/abapublic/ ... edirects=0

Here is the command line to cross-build the lib:

Code: Select all

make -f Makefile.win32 staticlib_win32 NDEBUG=1
Here is the error output when I cross-build my project:

Code: Select all

[...]/build/release-win32/CCore.o:CCore.cpp:(.text+0x216c): undefined reference to `__imp___ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimension2dIiEEjbbbPNS_14IEventReceiverE'

collect2: ld returned 1 exit status
As a proof of concept, here is the link to the Windows app I was able to build from Linux with a pre-compiled irrlicht lib 1.4.2, cross-builded ODE engine, mingw runtime and mingw pre-compiled win32-pthread and lua packages (and packaged with Inno Setup under wine):
http://sites.google.com/site/abapublic/ ... edirects=0
(If you want to give it a try, please rename it to setup.exe)
Post Reply