Linux compile error RTSProjectile.cc
by Chris Jones-Gill · in RTS Starter Kit · 11/26/2004 (10:11 am) · 10 replies
Problem comipling on RedHat 7.3..
main reason for comipling on this os is becuase this is the same OS we run our web/game server on.
main reason for comipling on this os is becuase this is the same OS we run our web/game server on.
--> Compiling game/RTS/RTSConnection.cc --> Compiling game/RTS/RTSProjectile.cc game/RTS/RTSProjectile.cc: In function 'void RTSProjectile::initPersistFields ()': game/RTS/RTSProjectile.cc:77: invalid reference to NULL ptr, use ptr-to-member instead game/RTS/RTSProjectile.cc:78: invalid reference to NULL ptr, use ptr-to-member instead game/RTS/RTSProjectile.cc:82: invalid reference to NULL ptr, use ptr-to-member instead game/RTS/RTSProjectile.cc:83: invalid reference to NULL ptr, use ptr-to-member instead make[1]: *** [out.GCC3.DEBUG/game/RTS/RTSProjectile.obj] Error 1 make: *** [default] Error 2appriciate any help with this one
#2
with GCC2 I still get the same error
11/26/2004 (11:40 am)
Yep your right - don't i feel like a prat hehe, anywaywith GCC2 I still get the same error
#3
11/26/2004 (2:43 pm)
From the looks of it it is failing on the Offset macro which should be from the console/consoleTypes.h file. Try to see which of the two defines it is using try swapping them. You may need to upgrade your compiler.
#4
Question would this affect any other part of the engine, especialy in the case of someone running the binary in a new kernel etc? and could I do something to the .mk file to save having to mess with this again
I also have had a lot of warnings mainly todo with the engine it'self, ( I know its the wrong place to put this should in the linux forum but save messing i'll stick it here)
like
terrain/terrData.cc: In method 'S32 TerrainBlock::getTerrainMapIndex
(Point3F &)':
terrain/terrData.cc:1635: warning: passing 'float' for argument 1 of
'Point2I::Point2I (int, int)'
terrain/terrData.cc:1635: warning: passing 'float' for argument 2 of
'Point2I::Point2I (int, int)'
I have saved my console output from the earlier failed build to here /rts-compile.txt
11/26/2004 (4:34 pm)
OK that worked in console/consoleType.h I did the following#ifndef Offset //#if defined(TORQUE_COMPILER_GCC) && (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)) #define Offset(m,T) ((int)(&((T *)1)->m) - 1) //#else //#define Offset(x, cls) ((dsize_t)((const char *)&(((cls *)0)->x)-(const char *)0)) //#endif #endifand the release and debug version build went ok but they won't run both have segfaults which proberly means that hasing thoise out was wrong for something else
Question would this affect any other part of the engine, especialy in the case of someone running the binary in a new kernel etc? and could I do something to the .mk file to save having to mess with this again
I also have had a lot of warnings mainly todo with the engine it'self, ( I know its the wrong place to put this should in the linux forum but save messing i'll stick it here)
like
terrain/terrData.cc: In method 'S32 TerrainBlock::getTerrainMapIndex
(Point3F &)':
terrain/terrData.cc:1635: warning: passing 'float' for argument 1 of
'Point2I::Point2I (int, int)'
terrain/terrData.cc:1635: warning: passing 'float' for argument 2 of
'Point2I::Point2I (int, int)'
I have saved my console output from the earlier failed build to here /rts-compile.txt
#5
11/26/2004 (5:52 pm)
Have you tried it with the second one instead? As to the warnings i wound't worry about i get something similar.
#6
yep i can safetly say it's
11/26/2004 (7:04 pm)
Sorry forgot to mention that,yep i can safetly say it's
#define Offset(x, cls) ((dsize_t)((const char *)&(((cls *)0)->x)-(const char *)0))thats causing the build to die
#7
11/26/2004 (7:15 pm)
Can you rebuild it for a debug build and run gdb to at least get a backtrace to see where it is segfaulting?
#8
in file RTSKit/engine/platformX86UNIX/x86UNIXWindow.cc
massive comment to show where it died
also ran a diff on that file with one from the SDK (sdk builds ok) and the files are identical
i ran it through some funny .sh scripts trying different libraries, got a bit more of a proper startup but died on
platformX86UNIX/x86UNIXFont.cc @ 121
createFont : cannot load font
did a forum search & found this www.garagegames.com/mg/forums/result.thread.php?qt=13990
which has no affect at all, also checked the same file in the sdk and thats the same & that runs
11/26/2004 (8:26 pm)
Yep - well used DDD but i got the following outputin file RTSKit/engine/platformX86UNIX/x86UNIXWindow.cc
massive comment to show where it died
also ran a diff on that file with one from the SDK (sdk builds ok) and the files are identical
//------------------------------------------------------------------------------
// Silly Korean registry key checker:
//------------------------------------------------------------------------------
ConsoleFunction( isKoreanBuild, bool, 1, 1, "isKoreanBuild()" )
{
Con::printf("WARNING: isKoreanBuild() is unimplemented");
return false;
}
//------------------------------------------------------------------------------
int main(S32 argc, const char **argv)
{
// init platform state
x86UNIXState = new x86UNIXPlatformState; ////////////////////////////// died on this line //////////////////////////////////////
// parse the command line for unix-specific params
Vector<char *> newCommandLine;
S32 returnVal = ParseCommandLine(argc, argv, newCommandLine);
if (returnVal != 0)
return returnVal;
// init lastTimeTick for TimeManager::process()
lastTimeTick = Platform::getRealMilliseconds();edit:i ran it through some funny .sh scripts trying different libraries, got a bit more of a proper startup but died on
platformX86UNIX/x86UNIXFont.cc @ 121
createFont : cannot load font
did a forum search & found this www.garagegames.com/mg/forums/result.thread.php?qt=13990
which has no affect at all, also checked the same file in the sdk and thats the same & that runs
#9
due to glibc and wanting to keep the same version of glibc as whats on our game/webservers,
i upgraded, well compiled the complete core,testsuite etc of GCC to 3.2(I think anything higher needs a newer version of glibc, binutils... the list goes on),
did a fresh install of RTS and it compiled with no probs
Funny thing was I was still getting the
platformX86UNIX/x86UNIXFont.cc @ 121
createFont : cannot load font
error, yet when i ran the SDK it works fine,
I spent 2 days going through the code and comparing the SDK to RTS, and found nothing.
My only opinion was that the RTS pack wasn't loading the Arial fonts from the common/ui/cache dir,
so I replaced these with the ones from the SDK and yet still no go,
THEN IT HIT ME
under mdk10 MDK10.1 and MDK9.1 I found that the tools/unix/mktplib.sh script wouldn't run,
this wasn't a permissions problem, as chmoded to 755, but something else, and using the same files from the sdk everything worked fine,
so as a last ditch attempt to get the RTS pack to run on RedHat7.3, in graphical mode,
I deleted the common dir from the RTS pack and copied over the common dir from the SDK
(yes I know there is some customised stuff for the RTS kit in there, but hey this is a trial & error situation)
and guess what it works
So guys something somewhere is corrupting the RTS pack in linux, whether its the installer, or what, I don't have a clue but for the tools/unix/mktplib.sh to be corrupt, yet still readable, then this needs to be addressed.
was the RTSKit for linux packaged on a linux system? or was it done on a windows box?, as it looks like your using the bitrock installer, which i know can run on either and create installers for both systems
Now here's a curious finding, right same day at the sametime, I downloaded the RTSKit for linux to the redhat box, the windows version to the win box, built both systems, dedicated and release & debug, ran the server on the linux box, and windows can't connect to it, moans that it's the wrong version of RTSKit?????
Strange, so if the linux version is corrupt, maybe this is why i had so many problems, and I am also wondering if anyone else has experienced this???
12/01/2004 (5:13 am)
@Benoit Touchette: OK i went one better over the last 2 days, did a fresh install of redhat7.3, downloaded the latest sdl inc mixer image etc and rebuit the rpms, latest openal, and built the latest mesa3d libraries,due to glibc and wanting to keep the same version of glibc as whats on our game/webservers,
i upgraded, well compiled the complete core,testsuite etc of GCC to 3.2(I think anything higher needs a newer version of glibc, binutils... the list goes on),
did a fresh install of RTS and it compiled with no probs
Funny thing was I was still getting the
platformX86UNIX/x86UNIXFont.cc @ 121
createFont : cannot load font
error, yet when i ran the SDK it works fine,
I spent 2 days going through the code and comparing the SDK to RTS, and found nothing.
My only opinion was that the RTS pack wasn't loading the Arial fonts from the common/ui/cache dir,
so I replaced these with the ones from the SDK and yet still no go,
THEN IT HIT ME
under mdk10 MDK10.1 and MDK9.1 I found that the tools/unix/mktplib.sh script wouldn't run,
this wasn't a permissions problem, as chmoded to 755, but something else, and using the same files from the sdk everything worked fine,
so as a last ditch attempt to get the RTS pack to run on RedHat7.3, in graphical mode,
I deleted the common dir from the RTS pack and copied over the common dir from the SDK
(yes I know there is some customised stuff for the RTS kit in there, but hey this is a trial & error situation)
and guess what it works
So guys something somewhere is corrupting the RTS pack in linux, whether its the installer, or what, I don't have a clue but for the tools/unix/mktplib.sh to be corrupt, yet still readable, then this needs to be addressed.
was the RTSKit for linux packaged on a linux system? or was it done on a windows box?, as it looks like your using the bitrock installer, which i know can run on either and create installers for both systems
Now here's a curious finding, right same day at the sametime, I downloaded the RTSKit for linux to the redhat box, the windows version to the win box, built both systems, dedicated and release & debug, ran the server on the linux box, and windows can't connect to it, moans that it's the wrong version of RTSKit?????
Strange, so if the linux version is corrupt, maybe this is why i had so many problems, and I am also wondering if anyone else has experienced this???
#10
It works fine there on NVidia hardware, here at work i have MDK 9.2 with updates from cooker up to 10.0 mixed in using a Parhelia and i get the problem. Will tinker with it when i get i chance hopefully friday to see if trying out what you mentions fixes it here.
12/01/2004 (8:39 am)
Thanks for the update, at home i run MDK10.1 CE, with some cooker packages thrown in :)It works fine there on NVidia hardware, here at work i have MDK 9.2 with updates from cooker up to 10.0 mixed in using a Parhelia and i get the problem. Will tinker with it when i get i chance hopefully friday to see if trying out what you mentions fixes it here.
Torque Owner Benoit Touchette