Page 1 of 1

Cannot compile on snow leopard (OSX 10.6)

Posted: October 20th, 2010, 12:59 am
by warrentr
Hi Guys,
I have been working through getting sandbox compiled on snow leopard.

The first issue I encountered was an error about missing macosx104u.sdk. I changed the xcode project settings to use macosx10.5.sdk (which comes with the newer version of xcode).

Then it will actually start compiling, but I get 20 errors. All the errors are about functions from the time library.

'time' was not declared in this scope
'localtime' was not declared in this scope

I could manually include <time.h> for all, but I feel like there must be an easier fix. This happens in server.cpp, master.cpp, rendergl.cpp and a few others.

Anyone come across this before?

Re: Cannot compile on snow leopard (OSX 10.6)

Posted: October 20th, 2010, 2:04 pm
by warrentr
I went back through the directions from popinman32 again (thanks for that wiki page btw), and wanted to note a couple things:
wiki: http://sandboxgamemaker.com/wiki/index. ... ource_code
1) SDL install: There are now binaries for snow leopard for sdl main, image, and mixer, and you must have them all installed to /System/Library/Frameworks
making sure that directory contains:
SDL.framework
SDL_image.framework
SDL_mixer.framework

2) the section that says "If you still have problems compiling, remove the folder includes inside enet". This means, remove this folder ONLY from the xcode project, NOT from disk.

I am still getting linker errors, but the 2 exes seem to have built.

Re: Cannot compile on snow leopard (OSX 10.6)

Posted: October 21st, 2010, 7:14 pm
by Popinman32
Did you remove all files other than the source files?
Could you please put your output on paste-bin or something like that?
Can you upload your project file?

I haven't seen this error before, or I have and I fixed it. So, I think the more info you can provide, the faster a fix can come out.
If this is the SVN version, they may have updated something. I'll go check this out. Expect a response in 48hr with test results from my 10.4, if you post your output and your project file I will most likely have a fix for you.

Re: Cannot compile on snow leopard (OSX 10.6)

Posted: June 20th, 2011, 10:00 pm
by ticker
Thanks for putting up the excellent page on compiling for Mac in XCode, popinman32. I'm running OS X 10.6.7 on an Intel Macbook pro. Trying to run SBox MPlatform 2.6.1 puts up the following error: "Sandbox cannot be opened because of a problem. Check wit the developer to make sure sandbox works with this version of Mac OS X. You may need to reinstall the application. Be sure to install any available updates for the application and Mac OS X."

OK, so now I want to try compiling the Multiplatform version from XCode. Before I throw myself into following your excellent step-by-step instructions, can you tell me if this version of sandbox has been known to compile and run on the latest version of Snow Leopard (i.e. 10.6.7)? Thanks, - ticker

Re: Cannot compile on snow leopard (OSX 10.6)

Posted: June 20th, 2011, 10:00 pm
by ticker
Sorry - double posted by mistake (too fast on the trigger finger ...)

Re: Cannot compile on snow leopard (OSX 10.6)

Posted: June 20th, 2011, 11:54 pm
by HYTutorials
warrentr wrote:Hi Guys,
I have been working through getting sandbox compiled on snow leopard.

The first issue I encountered was an error about missing macosx104u.sdk. I changed the xcode project settings to use macosx10.5.sdk (which comes with the newer version of xcode).

Then it will actually start compiling, but I get 20 errors. All the errors are about functions from the time library.

'time' was not declared in this scope
'localtime' was not declared in this scope

I could manually include <time.h> for all, but I feel like there must be an easier fix. This happens in server.cpp, master.cpp, rendergl.cpp and a few others.

Anyone come across this before?
I actually came across the exact same problem a few weeks ago. Even with including <time.h> manually, it still did not compile for me. I got errors for time and localtime as well.

Re: Cannot compile on snow leopard (OSX 10.6)

Posted: June 30th, 2011, 3:29 am
by salted33
Hi there, I've been encountering a similar problem. Whenever I try to build, it comes up with an error message that says:
GCC 4.2 is not compatible with the Mac OS X 10.4 SDK (file Launcher.m)
Does anyone know a way to get around this issue? (Or what I may very likely be doing wrong, I'm a long way from being an expert on these sort of things)

Re: Cannot compile on snow leopard (OSX 10.6)

Posted: July 2nd, 2011, 9:25 pm
by HYTutorials
You have to change your GCC to 4.3. To do this go to your xcode project settings. Then search up GCC in the search box and to in the drop down menu for GCC and change it to 4.3.