Game Development Community

Compile errors

by Jari · in Torque Game Engine · 06/12/2005 (8:44 am) · 6 replies

Hi! I have tackled already a bunch of compile errors using the info found on these forums but this one is really tricky... The problem is somewhere in the unix platform code and openGL lnclude files. I have compiled TGE before in windows so this must be platform/library issue.
I have made a KDevelop project, the GCC version is 3.4.1 and platform linux mandrake 10.1.

And these are the errors:

(I changed the paths bit to make the error messages fit in the post)
compiling x86UNIXDedicatedStub.cc (g++)
In file included from /x86UNIXDedicatedStub.cc:28:
platform/GLUFunc.h:6: error: 'void (*gluOrtho2D)(GLdouble, GLdouble, GLdouble, GLdouble)' redeclared as different kind of symbol
platform/GLUFunc.h:6: error: previous declaration of 'void gluOrtho2D(GLdouble, GLdouble, GLdouble, GLdouble)'
platform/GLUFunc.h:6: error: declaration of 'void (*gluOrtho2D)(GLdouble, GLdouble, GLdouble, GLdouble)'
platform/GLUFunc.h:6: error: conflicts with previous declaration 'void gluOrtho2D(GLdouble, GLdouble, GLdouble, GLdouble)'
platform/GLUFunc.h:7: error: 'void (*gluPerspective)(GLdouble, GLdouble, GLdouble, GLdouble)' redeclared as different kind of symbol
platform/GLUFunc.h:7: error: previous declaration of 'void gluPerspective(GLdouble, GLdouble, GLdouble, GLdouble)'
platform/GLUFunc.h:7: error: declaration of 'void (*gluPerspective)(GLdouble, GLdouble, GLdouble, GLdouble)'
platform/GLUFunc.h:7: error: conflicts with previous declaration 'void gluPerspective(GLdouble, GLdouble, GLdouble, GLdouble)'
platform/GLUFunc.h:8: error: 'void (*gluPickMatrix)(GLdouble, GLdouble, GLdouble, GLdouble, GLint*)' redeclared as different kind of symbol
platform/GLUFunc.h:8: error: previous declaration of 'void gluPickMatrix(GLdouble, GLdouble, GLdouble, GLdouble, GLint*)'
(and continues for all GL_FUNCTIONs in GLUFunc.h)
gmake[2]: *** [x86UNIXDedicatedStub.o] Error 1

Those errors are caused by these lines in x86UNIXDedicatedStub.cc:

// declare stub functions
#define GL_FUNCTION(fn_return, fn_name, fn_args, fn_value) fn_return stub_##fn_name fn_args{ fn_value }
#include "platform/GLCoreFunc.h"
#include "platform/GLExtFunc.h"
#include "platform/GLUFunc.h"
#undef GL_FUNCTION

// point gl function pointers at stub functions
#define GL_FUNCTION(fn_return,fn_name,fn_args, fn_value) fn_return (*fn_name)fn_args = stub_##fn_name;
#include "platform/GLCoreFunc.h"
#include "platform/GLExtFunc.h"
#include "platform/GLUFunc.h"
#undef GL_FUNCTION


The librarires included are:
zlib
png
jpeg
vorbis
lungif
SDL

Any ideas what could cause these errors are highly appreciated and welcome! :)

Thanks.

#1
06/12/2005 (9:01 am)
PlatformX86UNIX/x86UNIXDedicatedStub.cc Should only be built for the 'dedicated' target, if you're trying to build the normal client you shouldn't be compiling/linking that.

Look at the engine/targets.torque.mk

You'll see a SOURCE.PLATFORMX86UNIX and a SOURCE.PLATFORMX86UNIXDEDICATED

If you adjust the kdevelop settings to not build that (and match the SOURCE.PLATFORMX86UNIX sources) it should build just fine.
#2
06/12/2005 (9:44 am)
Aah great, thanks Gregory!

But now there is linking errors which I can't fix...

Could some one please take a look in to these errors?

mMathAMD.o(.text+0x9): In function 'mInstall_AMD_Math()':
/home/jari/therpg/source/KDevelop/server/src/math/mRandom.h:39: undefined reference to 'Athlon_MatrixF_x_MatrixF'
mMathSSE.o(.text+0x9): In function 'mInstall_Library_SSE()':
/home/jari/therpg/source/KDevelop/server/src/math/mRandom.h:39: undefined reference to 'SSE_MatrixF_x_MatrixF'
x86UNIXCPUInfo.o(.text+0x87): In function 'Processor::init()':
/home/jari/therpg/source/KDevelop/server/src/x86UNIXCPUInfo.cc:48: undefined reference to 'detectX86CPUInfo'
blender.o(.text+0x241): In function 'Blender::blend(int, int, int, unsigned short const*, unsigned short**)':
/home/jari/therpg/source/KDevelop/server/src/blender.cc:556: undefined reference to 'sTargetTexelsPerLumel_log2'
blender.o(.text+0x249):/home/jari/therpg/source/KDevelop/server/src/blender.cc:557: undefined reference to 'sTargetTexelsPerLumel'
blender.o(.text+0x253):/home/jari/therpg/source/KDevelop/server/src/blender.cc:559: undefined reference to 'sTargetTexelsPerLumelDiv2'
blender.o(.text+0x25e):/home/jari/therpg/source/KDevelop/server/src/blender.cc:560: undefined reference to 'nextsrcrow'
blender.o(.text+0x264):/home/jari/therpg/source/KDevelop/server/src/blender.cc:561: undefined reference to 'nextdstrow'
blender.o(.text+0x26d):/home/jari/therpg/source/KDevelop/server/src/blender.cc:563: undefined reference to 'nextdstrow'
blender.o(.text+0x27e):/home/jari/therpg/source/KDevelop/server/src/blender.cc:563: undefined reference to 'mip0_dstrowadd'
blender.o(.text+0x283):/home/jari/therpg/source/KDevelop/server/src/blender.cc:564: undefined reference to 'nextdstrow'
blender.o(.text+0x28d):/home/jari/therpg/source/KDevelop/server/src/blender.cc:564: undefined reference to 'mip1_dstrowadd'
blender.o(.text+0x298):/home/jari/therpg/source/KDevelop/server/src/blender.cc:565: undefined reference to 'nextsrcrow'
Leaving directory /home/jari/therpg/source/KDevelop/server/debug/src

blender.o(.text+0x29d):/home/jari/therpg/source/KDevelop/server/src/blender.cc:565: undefined reference to 'minus1srcrowsPlus8'
blender.o(.text+0x2a2):/home/jari/therpg/source/KDevelop/server/src/blender.cc:566: undefined reference to 'nextsrcrow'
blender.o(.text+0x2b4):/home/jari/therpg/source/KDevelop/server/src/blender.cc:566: undefined reference to 'srcrows_x2_MinusTPL'
blender.o(.text+0x4e8):/home/jari/therpg/source/KDevelop/server/src/blender.cc:659: undefined reference to 'doSquare2'
blender.o(.text+0x513):/home/jari/therpg/source/KDevelop/server/src/blender.cc:662: undefined reference to 'doSquare3'
blender.o(.text+0x53e):/home/jari/therpg/source/KDevelop/server/src/blender.cc:665: undefined reference to 'doSquare4'
blender.o(.text+0x77e):/home/jari/therpg/source/KDevelop/server/src/blender.cc:711: undefined reference to 'doLumelPlus1Mip'
blender.o(.text+0x7aa):/home/jari/therpg/source/KDevelop/server/src/blender.cc:716: undefined reference to 'do1x1Lumel'
blender.o(.text+0x839):/home/jari/therpg/sou
Leaving directory /home/jari/therpg/source/KDevelop/server/debug
rce/KDevelop/server/src/blender.cc:801: undefined reference to 'cheatmips'
blender.o(.text+0x85b):/home/jari/therpg/source/KDevelop/server/src/blender.cc:802: undefined reference to 'cheatmips'
blender.o(.text+0x87e):/home/jari/therpg/source/KDevelop/server/src/blender.cc:803: undefined reference to 'cheatmips4x4'

Looks like I'm missing some library?

Edit: GLU lib included still some linking errors
Edit: looks like i still need XFree86 ? ...
#3
06/12/2005 (10:40 am)
I included libXv which is AFAIK xFree86 library but no, still those same errors...
#4
06/12/2005 (6:12 pm)
You need nasm to assemble the *.asm files.

Specifically:
interior/itfdump.asm
math/mMathAMD_ASM.asm
math/mMathSSE_ASM.asm
platform/platformCPUInfo.asm
terrain/blender_asm.asm

I think you'll find all the missing symbols defined in those files.

Look in mk/conf.UNIX.mk for the ASMFLAGS that nasm is invoked with.
#5
06/13/2005 (10:53 am)
Alright thanks again Gregory!

I haven't been able to figure how to include the asm .o (after I assembled them) files in the linking process though. But I hope the kdevelop people will help with that...
#6
06/14/2005 (2:29 pm)
I would guess you could include them as a library object or some such, sorry I don't use kdevelop so I have no idea how to go about it. The existing build system works for me :)