Irrlicht 1.1 errors on OS X - Fixes to get it to compile
Posted: Thu Sep 28, 2006 5:37 am
Hi all, I'm new to the forums and new to Irrlicht. I'm an OS X user and when I tried to compile Irrlicht 1.1 (that I downloaded from the main site) on OS X (10.4.7) I got a bunch of errors, so I set out to fix them. I fixed all of the errors that prevented compilation and so now it compiles and many of the demo programs work (more or less) although several do not.
I uploaded the source file directory with all the fixes and a text file documenting them all to my server here: http://www.kinostudios.com/OS_X_fixes_irrlicht1.1.zip
Here is a copy of that text file with the fixes:
Several of the demo programs refuse to launch, while others do. I had time to only look into one of them, but the problem could be the same for all of them.
SpecialFx crashes:
By commenting out line 86 in the main.cpp of SpecialFx I was able to get the program to run successfully. This is the line:
node->getMaterial(0).SpecularColor.set(0,0,0,0);
Perhaps someone could take a look into this and find out why this is happening? My guess is that it has something to do with the getMaterial() function, which, by the way, doesn't make any sense to me as to how it could possibly work in the first place:
What does that do? It seems to me like it tries to dereference a pointer to NULL...
Anyways, I hope that these fixes are useful, and if they haven't already been done in the SVN version then I'd be happy if they were incorporated into the Irrlicht 1.1 version on the main site.
I uploaded the source file directory with all the fixes and a text file documenting them all to my server here: http://www.kinostudios.com/OS_X_fixes_irrlicht1.1.zip
Here is a copy of that text file with the fixes:
Misc problems:error:
CImageLoaderPCX.cpp:66-75
XMin, XMax, YMin, etc not declared
solution:
prefix them with 'header.'
error:
CStaticMeshOBJ.cpp: No such file or directory
solution:
Got rid of old files in Xcode group "Engine", replaced with latest ones
error:
COpenGLSLMaterialRenderer.cpp:187,215:
invalid conversion from 'int*' to 'GLsizei*'
solution:
make explicit casts to GLsizei*
error:
COpenGLDriver.cpp:184
constructor poorly formed.
solution:
was missing the 'bool vsync' argument
error:
COpenGLDriver.cpp:542
pGlActiveTextureARB and pGlClientActiveTextureARB not declared in scope
solution:
replace with:
#ifndef MACOSX
if (!pGlActiveTextureARB || !pGlClientActiveTextureARB)
{
MultiTextureExtension = false;
os::Printer::log("Failed to load OpenGL's multitexture extension, proceeding without.", ELL_WARNING);
}
else
#endif
if (MaxTextureUnits < 2)
{
MultiTextureExtension = false;
os::Printer::log("Warning: OpenGL device only has one texture unit. Disabling multitexturing.", ELL_WARNING);
}
error:
COpenGLDriver.cpp:2567
no matching function call to 'irr::video::COpenGLDriver::COpenGLDriver(const irr::core::dimension2d<irr::s32>&, bool&, bool&, irr::CIrrDeviceMacOSX*&, irr::io::IFileSystem*&, bool&)'
solution:
vsync parameter missing; line 2567 change to:
device, io, vsync, antiAlias);
Several of the demo programs refuse to launch, while others do. I had time to only look into one of them, but the problem could be the same for all of them.
SpecialFx crashes:
Code: Select all
Using renderer: OpenGL 1.3
ATI Radeon 9000 OpenGL Engine: ATI Technologies Inc.
OpenGL driver version is 1.2 or better.
Multittexturing active.
Loaded texture: #DefaultFont
Loaded mesh: ../../media/room.3ds
Loaded texture: ../../media/wall.jpg
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000010
main () at ../../../include/SColor.h:218
218 inline void set(s32 a, s32 r, s32 g, s32 b) { color = (((a & 0xff)<<24) | ((r & 0xff)<<16) | ((g & 0xff)<<8) | (b & 0xff)); }
(gdb) bt
#0 main () at ../../../include/SColor.h:218
(gdb) quit
By commenting out line 86 in the main.cpp of SpecialFx I was able to get the program to run successfully. This is the line:
node->getMaterial(0).SpecularColor.set(0,0,0,0);
Perhaps someone could take a look into this and find out why this is happening? My guess is that it has something to do with the getMaterial() function, which, by the way, doesn't make any sense to me as to how it could possibly work in the first place:
Code: Select all
virtual video::SMaterial& getMaterial(s32 i)
{
return *((video::SMaterial*)0);
}
Anyways, I hope that these fixes are useful, and if they haven't already been done in the SVN version then I'd be happy if they were incorporated into the Irrlicht 1.1 version on the main site.