Game Development Community

Trouble Compiling

by Dustin Williams · in Torque Game Engine · 01/22/2005 (1:23 pm) · 6 replies

I am attempting to compile the TGE SDK in linux by going to the freshly installed Torque directory and doing a make. I had a couple problems before, and I fixed them, but now I'm getting tons of errors with x86UNIXState.h. Here are the errors:

Quote:
--> Compiling platformX86UNIX/x86UNIXConsole.cc
--> Compiling platformX86UNIX/x86UNIXFileio.cc
In file included from platformX86UNIX/x86UNIXFileio.cc:31:
platformX86UNIX/x86UNIXState.h:15:62: X11/Xlib.h: No such file or directory
In file included from platformX86UNIX/x86UNIXFileio.cc:31:
platformX86UNIX/x86UNIXState.h:36: error: syntax error before '*' token
platformX86UNIX/x86UNIXState.h:37: error: 'Window' is used as a type, but is
not defined as a type.
platformX86UNIX/x86UNIXState.h:38: error: syntax error before '*' token
platformX86UNIX/x86UNIXState.h:56: error: syntax error before '*' token
platformX86UNIX/x86UNIXState.h:58: error: semicolon missing after declaration
of 'x86UNIXPlatformState'
platformX86UNIX/x86UNIXState.h:61: error: 'Display' was not declared in this
scope
platformX86UNIX/x86UNIXState.h:61: error: 'displayPointer' was not declared in
this scope
platformX86UNIX/x86UNIXState.h:62: error: variable or field 'setDisplayPointer'
declared void
platformX86UNIX/x86UNIXState.h:62: error: syntax error before '{' token
platformX86UNIX/x86UNIXState.h: In function 'void setScreenNumber(int)':
platformX86UNIX/x86UNIXState.h:64: error: 'mScreenNumber' undeclared (first use
this function)
platformX86UNIX/x86UNIXState.h:64: error: (Each undeclared identifier is
reported only once for each function it appears in.)
platformX86UNIX/x86UNIXState.h: At global scope:
platformX86UNIX/x86UNIXState.h:67: error: 'Screen' was not declared in this
scope
platformX86UNIX/x86UNIXState.h:67: error: 'newScreenPointer' was not declared
in this scope
platformX86UNIX/x86UNIXState.h:68: error: variable or field 'setScreenPointer'
declared void
platformX86UNIX/x86UNIXState.h:68: error: syntax error before '{' token
platformX86UNIX/x86UNIXState.h:69: error: syntax error before '*' token
platformX86UNIX/x86UNIXState.h: In function 'void setDesktopBpp(int)':
platformX86UNIX/x86UNIXState.h:75: error: 'mDesktopBpp' undeclared (first use
this function)
platformX86UNIX/x86UNIXState.h: In function 'void setDesktopSize(int, int)':
platformX86UNIX/x86UNIXState.h:82: error: 'mDesktopSize' undeclared (first use
this function)
platformX86UNIX/x86UNIXState.h: At global scope:
platformX86UNIX/x86UNIXState.h:85: error: 'Window' was not declared in this
scope
platformX86UNIX/x86UNIXState.h:85: error: parse error before ')' token
platformX86UNIX/x86UNIXState.h: In function 'void setWindow(...)':
platformX86UNIX/x86UNIXState.h:85: error: 'mCurrentWindow' undeclared (first
use this function)
. . .

And so on... There's still more than twice that much left, but all except the last two (which are for x86UNIXFileio.cc) have to do with x86UNIXState.h.

How can I fix this?

#1
01/22/2005 (3:13 pm)
My experience with compile errors is you should ignore all but the first. The first is a real error. The rest tend to be just symptoms of the first. Here is your first error:
In file included from platformX86UNIX/x86UNIXFileio.cc:31:
platformX86UNIX/x86UNIXState.h:15:62:
X11/Xlib.h: No such file or directory

This file (Xlib.h) is not in my copy of Torque. Neither is the directory. I am assuming then, that Torque is expecting to find this file already on your machine. Go find it yourself. Write down where it is. Now open x86UNIXState.h and look for the appropriate include statement (find: xlib.h). Is it looking in the right place? I'm guessing no. Tell it a more appropriate place to look and your problem should disappear.

Oh, and take my advice with a grain of salt. I'm a Windows user. :)
#2
01/22/2005 (10:59 pm)
Turns out I don't have xlib-dev. Kind of important when compiling stuff that interfaces with X. :) Thanks a lot.
#3
01/23/2005 (12:22 am)
OK, I can compile a clean install of the Torque SDK on Linux without problems, but now I want to compile my modified source in Linux. One of the things I added in Windows to the SDK was the Turrets resource. Here are the make errors:

Quote:
--> Compiling game/main.cc
In file included from game/turrets/aiTurret.h:13,
from game/turrets/aiTurret.cc:8,
from game/main.cc:60:
game/turrets/turret.h:179:20: warning: no newline at end of file
In file included from game/main.cc:60:
game/turrets/aiTurret.cc: In member function 'bool
AITurret::isReachableAngle(GameBase*)':
game/turrets/aiTurret.cc:623: error: no matching function for call to 'AITurret
::getAnglesFromAimLocation(Point3F&, Point3F, F32&, F32&)'
game/turrets/aiTurret.cc:541: error: candidates are: void
AITurret::getAnglesFromAimLocation(VectorF&, VectorF&, F32&, F32&)
game/turrets/aiTurret.cc: In function 'S32 cAITurretgetAimObject(AITurret*,
int, const char**)':
game/turrets/aiTurret.cc:884: warning: converting of negative value '-1' to '
unsigned int'
game/turrets/aiTurret.cc: In function 'S32 cAITurretgetTarget(AITurret*, int,
const char**)':
game/turrets/aiTurret.cc:942: warning: converting of negative value '-1' to '
unsigned int'
make[1]: *** [out.GCC2.RELEASE/game/main.obj] Error 1
make: *** [default] Error 2

How do I fix this?
#4
01/23/2005 (7:34 am)
Ignore the warning about newlines. Your linux compiler doesn't like files that were created/edited in windows, but it will get over this :p

Here is the first real error:

game/turrets/aiTurret.cc:623: error: no matching function for call to
'AITurret::getAnglesFromAimLocation(Point3F&, Point3F, F32&, F32&)'
...candidates are:
void AITurret::getAnglesFromAimLocation(VectorF&, VectorF&, F32&, F32&)

So you are trying to call a method that takes VectorF arguments, but you are supplying it with Point3F arguments instead. I'm going to assume for the moment that the compiler is right about this and you are using the wrong type of arguments to call this method. Do you have some evidence to convince me otherwise? Important pieces of information here would be:
1) first line of getAnglesFromAimLocation, which shows what arguments it expects.
2) the line where you tried and failed to call this method.
3) the variable declarations of any variables that you used as arguments.

On a side note, do you have a link to the turret resource that you're trying to use?
#5
01/23/2005 (10:43 pm)
Turns out that things are exactly the way you say. However, it appears that MS Visual Studio doesn't care and GCC2 does. I don't actually need any of the ai turret code in my game so I just commented out that line and it compiled fine. Thanks a lot for your help!
#6
01/24/2005 (10:59 am)
VectorF is actually just a simple typedef of Point3F which is probably why Windows doesn't care.