1.5 Win32/gcc build error

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

I did, and now I have Code::Blocks as well.

Right, SVN 1909 on the 1.5 branch restores the 1902 functionality: IdentityMatrix is declared but not defined with IRRLICHT_API.

I have tested this with both MSVC and mingw via Code::Blocks. I've added a test case for it, and a Code::Blocks test project (/tests/tests.cbp) which all works as expected.

The Code::Blocks project(s) also seem screwed up. Irrlicht_Win32-gcc.cbp didn't define __GNUWIN32__, so Irrlicht.cpp failed to compile due to trying to #include <crtdbg.h>

I've added that definition, which also updated Irrlicht_Win32-gcc.cbp to the C::B 8.02 version. ( <FileVersion major="1" minor="6" /> ). Apologies if this screws anyone over, but I don't fancy maintaining an older format by hand when I'm not familiar with it. We can always revert it if it causes problems.

The C::B example projects (or at least the Hello World one) look for libIrrlicht.a in ../../lib/Win32-gcc, which is peculiar as Irrlicht cbp builds that library in ../../bin/Win32-gcc. I won't update those yet until you C::Bers have a chance to shout out.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
zeroZshadow
Posts: 43
Joined: Mon Dec 01, 2008 6:35 pm

Post by zeroZshadow »

cool, i'll switch from trunk to branch 1.5 then.
and now i'll have to fix all the damn stuff again =.=
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Sorry about the inconvenience, but until we get 1.5 released, you should consider it to be the de facto development trunk. All of the fixes are going on to 1.5 first, and are only moved to the trunk in batches.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
zeroZshadow
Posts: 43
Joined: Mon Dec 01, 2008 6:35 pm

Post by zeroZshadow »

works perfectly fine now *happy*
now.. to find a fix for that damn shared animation speed / frames for my models
wyrmmage
Posts: 204
Joined: Sun Mar 16, 2008 3:12 am
Contact:

Post by wyrmmage »

I'm trying to get my SConstruct file working, but I'm having a couple of problems with it :\

I've added the flag for __GNUWIN32__ which, as you said, fixed the crtdbg problem, but I'm still getting the

Code: Select all

Irrlicht.cpp:44: error: external linkage required for symbol 'irr::core::Identit
yMatrix' because of 'dllexport' attribute.
error.

Adding the _IRR_STATIC_LIB_ flag gives me these errors:

Code: Select all

Creating library file: libIrrlicht.a
CIrrDeviceWin32.o: In function `ZN3irr15CIrrDeviceWin3217activateJoysticksERNS_4
core5arrayINS_13SJoystickInfoENS1_12irrAllocatorIS3_EEEE':
D:/irrlicht svn/irrlicht/tags/release-1.5.beta/source/Irrlicht/CIrrDeviceWin32.c
pp:972: undefined reference to `joyGetNumDevs@0'
D:/irrlicht svn/irrlicht/tags/release-1.5.beta/source/Irrlicht/CIrrDeviceWin32.c
pp:986: undefined reference to `joyGetPosEx@8'
D:/irrlicht svn/irrlicht/tags/release-1.5.beta/source/Irrlicht/CIrrDeviceWin32.c
pp:986: undefined reference to `joyGetDevCapsA@12'
CIrrDeviceWin32.o: In function `ZN3irr15CIrrDeviceWin3213pollJoysticksEv':
D:/irrlicht svn/irrlicht/tags/release-1.5.beta/source/Irrlicht/CIrrDeviceWin32.c
pp:1034: undefined reference to `joyGetPosEx@8'
collect2: ld returned 1 exit status
scons: *** [Irrlicht.dll] Error 1
I'm using the mingw compiler on Windows.

Any ideas? :)
-wyrmmage
Worlds at War (Current Project) - http://www.awkward-games.com
Ganadu'r, The Eternal Sage (Other Current Project) - http://rpg.naget.com
wyrmmage
Posts: 204
Joined: Sun Mar 16, 2008 3:12 am
Contact:

Post by wyrmmage »

Well, I figured out what was wrong :)

The patch is below, and it's also in the tracker:

Code: Select all

Index: SConstruct
===================================================================
--- SConstruct	(revision 1913)
+++ SConstruct	(working copy)
@@ -6,7 +6,7 @@
 PROFILE = 1;
 
 APPLICATION_NAME = 'Irrlicht';
-LIBRARIES = ['gdi32', 'opengl32', 'd3dx9d'];
+LIBRARIES = ['gdi32', 'opengl32', 'd3dx9d', 'winmm'];
 if USE_GCC==1 and PROFILE==1:
 	LIBRARIES += ['gmon'];
 
@@ -81,7 +81,10 @@
 if PROFILE:
 	CXXFLAGS += ['-pg'];
 
-CXXFLAGS += ['-DPNG_NO_MMX_CODE', '-DPNG_NO_MNG_FEATURES', '-DIRRLICHT_EXPORTS=1'];
+CXXFLAGS += ['-DPNG_NO_MMX_CODE', '-DPNG_NO_MNG_FEATURES', '-DIRRLICHT_EXPORTS=1', '-D_IRR_STATIC_LIB_'];
+if USE_GCC:
+	CXXFLAGS += ['-D__GNUWIN32__=1'];
+
 env.Append(CCFLAGS = CXXFLAGS);
 
 IrrlichtLibrary = env.SharedLibrary("Irrlicht.dll", LINKOBJ);
-wyrmmage
Worlds at War (Current Project) - http://www.awkward-games.com
Ganadu'r, The Eternal Sage (Other Current Project) - http://rpg.naget.com
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Great, thanks. We already have winmm on the 1.5 branch, but I've added the __GNUWIN32__ flag in SVN 1921.

Can I suggest that you use the 1.5 branch for now, since all the fixes are going there.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
wyrmmage
Posts: 204
Joined: Sun Mar 16, 2008 3:12 am
Contact:

Post by wyrmmage »

Thanks for the quick commit! I'll have to remember to use the 1.5 branch :)
Worlds at War (Current Project) - http://www.awkward-games.com
Ganadu'r, The Eternal Sage (Other Current Project) - http://rpg.naget.com
jonim8or
Posts: 4
Joined: Wed Mar 04, 2009 9:28 am

Post by jonim8or »

I'm trying to compile the Irrlicht 1.5 sdk (from the zip file and from svn) using mingw32 under windows xp.
I go to the source folder, and run

Code: Select all

mingw32-make sharedlib
However I get the following error:

Code: Select all

Irrlicht.cpp:12:22: crtdbg.h: No such file or directory
Irrlicht.cpp: In function `BOOL DllMain(void*, DWORD, void*)':
Irrlicht.cpp:61: error: `_CRTDBG_LEAK_CHECK_DF' was not declared in this scope
Irrlicht.cpp:61: error: `_CRTDBG_ALLOC_MEM_DF' was not declared in this scope
Irrlicht.cpp:61: error: `_CrtSetDbgFlag' was not declared in this scope
Irrlicht.cpp:61: warning: unused variable '_CRTDBG_LEAK_CHECK_DF'
Irrlicht.cpp:61: warning: unused variable '_CRTDBG_ALLOC_MEM_DF'
Irrlicht.cpp:61: warning: unused variable '_CrtSetDbgFlag'
apparently it can't find crtdbg.h, which really is not in the source directory. How do I fix this?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Just read what was said above, and fix the Makefile accrodingly. If you cannot do that, you have to switch to the SVN-branch which has this already fixed, or you use an IDE which does the proper defines for you.
jonim8or
Posts: 4
Joined: Wed Mar 04, 2009 9:28 am

Post by jonim8or »

Hi,

Thanks for the reply, but I've tried that.
I have checkouted the 1.5 branch, applied the patch, but still get that message.

What is going wrong?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The branch doesn't need a patch, at least that was the idea. I've moved the define to another place in the project file, please try again with revision 2253.
jonim8or
Posts: 4
Joined: Wed Mar 04, 2009 9:28 am

Post by jonim8or »

It appears the file crtdbg.h is supplied with visual studio. But I don't use visual studio, so I don't have the file. How can I get the crtdbg.h file for mingw?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You simply don't need it. Just clean up your defines and everything should compile as expected.
jonim8or
Posts: 4
Joined: Wed Mar 04, 2009 9:28 am

Post by jonim8or »

I've found it. I hade to explicitly tell it to make windows version, otherwise gnuwin would not be set.

Code: Select all

mingw32-make win32
Then it gave another problem: the makefile uses cc as compiler, but the mingw compiler is called gcc. renaming the compiler, compiling and renaming back works as a one-time solution, but there should probably be a better one.

thanks for the help.
Post Reply