Game Development Community

Include statements in xcode

by David Sill · in Torque Game Engine · 01/21/2005 (10:40 am) · 5 replies

I'm trying to compile TGE for Mac. I'm pretty new to programming. In the code I have is an include for "windows.h" (which refers to a standard library in Visual Studio). Obviously this library isn't there for the Mac.

So the easy question of the day is this:

What is the equivalent library to include in XCode? I tried "carbon/carbon.h" and got a whole list of errors.

If I comment it out, I get fewer errors but still enough so I can't test for my custom functionality (created by a third party).

please help a clueless n00b.

#1
01/22/2005 (8:38 am)
You are probably compiling the whole thing in a wrong manner.

When you downloaded TGE you got a directory named "pb", there's where your Xcode project will be. It will have all the proper includes you need.

Don't try changing the engine's includes before you get a firm grip on what the engine does. Reverting everything to it's original content will help you compile it right for the first time.

Also check the readmes and docs for compiling in mac and adjusting your Xcode preferences and stuff.

You'll also find more help by posting in the Mac section of the forums.

HTH
#2
01/22/2005 (12:11 pm)
Bruno, I think he has code that is not stock Torque that he wants to use, and it wants windows.h.

David, there is no straight equivilant. What functions does it use from the Windows include header?
#3
01/23/2005 (10:34 am)
Yes it is custom code.

it involves copying files using Torque - there is a button in the load screen that copies and names a file in the background.

this is the error I get:

../engine/core/resManager.cc:161: error: 'CopyFile' undeclared (first use this function)

and the line of code it's complaining about:

CopyFile(source, dest, FailIfExists);

I don't know whether it'd be easier to find the right library or to declare what it's saying isn't declared.

it's a pretty basic Finder function. I thought it'd be pretty much built in.

any ideas?

(edited for typos)
#4
01/24/2005 (8:30 am)
You just stumped on an error posted by Gonzo T. Clown last week. There is no CopyFile function in the Mac port :-(

Read his post for more info

Gonzo's Post
#5
01/24/2005 (10:49 am)
Torque wraps the fileio of OS's it supports already. I suggest looking in the platform code in Torque for any fileio functions you can use.