Game Development Community

Problem compiling some files in new HEAD with gcc-3 + workaround

by Vincent Cojot · in Torque Game Engine · 08/05/2003 (5:03 am) · 3 replies

Hi All,

After an update with CVS HEAD, I got these things (many lines omitted but you get the idea..)

g++3 -pipe -I/usr/openwin/include -DUSE_FILE_REDIRECT -MD -w -mno-stack-bias -mno-faster-structs -munaligned-doubles -m32 -mptr32 -g -DTORQUE_DEBUG -I../lib/lungif -I../lib/ljpeg -I../lib/zlib-1.1.4 -I../lib/lpng-1.0.15 -I../lib/openal/SunSolaris -I/usr/local/include -I. -c -o out.GCC3.DEBUG/editor/terrainEditor.obj editor/terrainEditor.cc
editor/terrainEditor.cc:1133: 'void cTerrainEditorattachTerrain(TerrainEditor*,
int, const char**)' was declared 'extern' and later 'static'
editor/terrainEditor.h:163: previous declaration of 'void
cTerrainEditorattachTerrain(TerrainEditor*, int, const char**)'
editor/terrainEditor.cc:1178: 'void cTerrainEditorsetBrushType(TerrainEditor*,
int, const char**)' was declared 'extern' and later 'static'
editor/terrainEditor.h:165: previous declaration of 'void
cTerrainEditorsetBrushType(TerrainEditor*, int, const char**)'
editor/terrainEditor.cc:1202: 'void cTerrainEditorsetBrushSize(TerrainEditor*,
int, const char**)' was declared 'extern' and later 'static'
editor/terrainEditor.h:167: previous declaration of 'void
cTerrainEditorsetBrushSize(TerrainEditor*, int, const char**)'
editor/terrainEditor.cc:1220: 'const char*
cTerrainEditorgetBrushPos(TerrainEditor*, int, const char**)' was declared
'extern' and later 'static'

I found 2 files so far that are affected by that kind of problem:

engine/editor/terrainEditor.cc
engine/editor/worldEditor.cc

The (ugly) workaround I found was to add '-fpermissive' to my compiler flags.

That's under Solaris, btw, but I usually get the same results under Linux when using the same compiler...

Vincent

#1
08/05/2003 (5:12 am)
Game/net/net.cc also suffers from that problem:

g++3 -pipe -I/usr/openwin/include -DUSE_FILE_REDIRECT -MD -w -mno-stack-bias -mno-faster-structs -munaligned-doubles -m32 -mptr32 -g -DTORQUE_DEBUG -I../lib/lungif -I../lib/ljpeg -I../lib/zlib-1.1.4 -I../lib/lpng-1.0.15 -I../lib/openal/SunSolaris -I/usr/local/include -I. -c -o out.GCC3.DEBUG/game/net/net.obj game/net/net.cc
game/net/net.cc:197: 'void cremoveTaggedString(SimObject*, int, const char**)'
was declared 'extern' and later 'static'
sim/netStringTable.h:26: previous declaration of 'void
cremoveTaggedString(SimObject*, int, const char**)'
game/net/net.cc:202: 'const char* caddTaggedString(SimObject*, int, const
char**)' was declared 'extern' and later 'static'
sim/netStringTable.h:27: previous declaration of 'const char*
caddTaggedString(SimObject*, int, const char**)'
game/net/net.cc:213: 'const char* cgetTaggedString(SimObject*, int, const
char**)' was declared 'extern' and later 'static'
sim/netStringTable.h:28: previous declaration of 'const char*
cgetTaggedString(SimObject*, int, const char**)'
game/net/net.cc:221: 'const char* cbuildTaggedString(SimObject*, int, const
char**)' was declared 'extern' and later 'static'
sim/netStringTable.h:29: previous declaration of 'const char*
cbuildTaggedString(SimObject*, int, const char**)'
gmake: *** [out.GCC3.DEBUG/game/net/net.obj] Error 1

Vincent
#2
08/05/2003 (5:26 am)
Also sceneGraph/lightManager.cc

I think the problem is with friend_ConsoleFunction...

Vincent

g++3 -pipe -I/usr/openwin/include -DUSE_FILE_REDIRECT -MD -w -mno-stack-bias -mno-faster-structs -munaligned-doubles -m32 -mptr32 -g -DTORQUE_DEBUG -I../lib/lungif -I../lib/ljpeg -I../lib/zlib-1.1.4 -I../lib/lpng-1.0.15 -I../lib/openal/SunSolaris -I/usr/local/include -I. -c -o out.GCC3.DEBUG/sceneGraph/lightManager.obj sceneGraph/lightManager.cc
sceneGraph/lightManager.cc:32: 'void cresetLighting(SimObject*, int, const
char**)' was declared 'extern' and later 'static'
sceneGraph/lightManager.h:54: previous declaration of 'void
cresetLighting(SimObject*, int, const char**)'
gmake: *** [out.GCC3.DEBUG/sceneGraph/lightManager.obj] Error 1
#3
08/05/2003 (4:58 pm)
I've checked in some updated makefiles that appear to fix the problem.