Game Development Community

External Library Compilation Troubles

by practicing01 · in Torque 2D Professional · 01/30/2014 (5:03 pm) · 4 replies

I'm trying to compile Assimp ( http://assimp.sourceforge.net/ ) with T2D and I'm getting this error:

In file included from /usr/include/GL/freeglut_std.h:120:0,
from /usr/include/GL/glut.h:17,
from ../../source/Banana_Modifications/Struct_Module_Assimp/Struct_Module_Assimp.h:6,
from ../../source/game/defaultGame.cc:63:
/usr/include/GL/gl.h:776:47: error: ‘void glClearIndex(GLfloat)’ redeclared as different kind of symbol


The platform is 32bit Ubuntu. Can anyone please point me in the right direction on how to get past this error? The only place in the source where that function exists is within platform/GLCoreFunc.h.

#1
01/30/2014 (9:31 pm)
From a quick glance, it seems like the /usr/include/GL/gl.h redeclares what T2D already declares, i.e. function glClearIndex.

My guess is to make sure that Assimp is loaded after T2D initializes the OpenGL platform and modify AssImp so that it doesn't rely on /usr/include/GL/gl.h but uses T2D's version instead.
#2
01/31/2014 (12:47 am)
Thanks for the reply. I got it to compile by messing around with stuff. I'm calling some functions within DefaultGame::mainLoop() and stuff works fine untill the first opengl call it finds, then boom. Any ideas on that? Here's the commit: https://github.com/practicing01/Torque2D/commit/2aac240c804eba6bca2c4613f649f31970e05f57
#3
01/31/2014 (1:12 am)
Knowing the exact errors might help, another thing to keep in mind is that the OpenGL implementation in T2D is based on OpenGL 1.2; it is entirely possible that some functions are simply not implemented as of yet.

The main issue with updating T2D to use OpenGL 3 or 4 is that newer versions of OpenGL rely heavily on vertex and fragment shaders, which would require a rewrite of how T2D handles most graphical things.
#4
01/31/2014 (1:35 am)
Oops! How silly of me to not post the error message >_<. www.pastebin.com/ghtd7BLH