Game Development Community

Weird compile error on Mac.

by Nmuta Jones · in Torque Game Engine · 03/30/2010 (8:44 pm) · 8 replies

I am using G. Notman's pathfinding resource:
thread: www.torquepowered.com/community/resources/view/14495/
downloads: www.gabriel-notman.com/upload/PathFinding.zip

Been using it for a year now on PC, works and compiles fine.

but just tried to compile on Mac, and getting these errors:

www.mediabreeze.com/Picture2.jpg
in game/AIPathGroup.cc

error: 'FileStream::AccessMode' is not an aggregate type
error: 'FileStream::AccessMode' is not an aggregate type
error: 'FileStream::AccessMode' is not an aggregate type
error: 'FileStream::AccessMode' is not an aggregate type
In Fuction 'void cAIPathGroupaddObjectSafe(AIPathGroup*,int,const char**)':

error: 'strupr' undeclared (first use this function)


What could be the problem? I added all four source code files to the xcode project. compiling Torque 1.5.2 using AFX on xcode 2.5 on Tiger.

Someone suggested that I include core/fileStream.h, (at the top of AiPathGroup.h) because it does not "know" that FileStream has been defined previously. I also tried including it at the top of AiPathGroup.cc as well.

Well, I did that, but it is still not working.....getting the same error.

Any ideas, anyone?

#1
03/31/2010 (12:11 am)
Try a "Build/Clean all targets" before re-compiling.
Sometimes it helps.

Nicolas Buquet
www.buquet-net.com/cv/
#2
03/31/2010 (9:35 am)
@Nicolas

Yeah, unfortunately I already tried cleaning, building, and cleaning again. four times.

I have no idea why this is not compiling. I am to the point where I would hire someone to compile this for me.

I am able to compile Stock TGE 1.5.2 with AFX on the Mac with xcode with no problem.

so I can't figure out what could be wrong with this.
I will pay anyone a half hour's worth of labor to do this for me.
#3
03/31/2010 (10:30 am)
Let me save you some money.

FileStream::AccessMode isn't an aggregate type. Anywhere you see something like FileStream::AccessMode::Write is wrong, Remove ::AccessMode. So, change FileStream::AccessMode::Write to FileStream::Write, FileStream::AccessMode::Read to FileStream::Read, etc.

strupr isn't a standard C function. Use dStrupr, Torque's function to uppercase a string.
#4
03/31/2010 (10:46 am)
oh wow...let me try that....
#5
03/31/2010 (12:01 pm)
btw the AIPathGroup.cc file which contains

FileStream::AccessMode::Write,

etc.

works fine when compiled on PC using VS2008 Express Edition. Why is this? is the compiler simply overlooking the AccessMode namespace and "writing" ...

its a pathfinding resource by G. Notman and it works brilliantly .

#6
03/31/2010 (12:08 pm)
It works because Visual Studio tends to accept technically invalid code that it can still make sense of. GCC is more pedantic and tends to require that devs stick to the defined C++ standard.
#7
03/31/2010 (12:34 pm)
@Alex

YEAAAAH! Thank you so much !!! You were absolutely correct.
I will be posting on the resource itself to advise the author of these code glitches.

So that dreaded AiPathGroup.cc file is now actually compiling.

The only error at this point is this one: a string of "undefined symbols".
You or anyone else have a sense of what this is about?

(full image located at: http://gailmanker.com/site/wp-content/uploads/2010/03/picture3.jpg)


www.gailmanker.com/site/wp-content/uploads/2010/03/picture3.jpg
#8
03/31/2010 (12:56 pm)
the error was so long it had to span two different screenshots:

gailmanker.com/site/wp-content/uploads/2010/03/picture3.jpg

and

gailmanker.com/site/wp-content/uploads/2010/03/picture4.jpg


Hopefully for someone who knows what that are seeing this will be less of a puzzle.

"Does not match cpu type..."???? I don't understand how to address this. Stock AFX compiles fine on this Mac. and these changes don't APPEAR at least to be to the pathfinding code...or do they? Not sure. Hard for me to trace .