can't compile for GLFW in V1.66

Monkey Forums/Monkey Bug Reports/can't compile for GLFW in V1.66

Tri|Ga|De(Posted 2012) [#1]
I'm getting this error code:

../glfw/lib/internal.h:58:10: fatal error: 'stdlib.h' file not found
#include <stdlib.h>
         ^
1 error generated.


TRANS FAILED: TRANS Failed to execute 'xcodebuild -configuration Release', return code=16640


I've added some more of the error text.

I'm using XCode 4.5.1

I tried to change the project to 10.7 but that did not help.


Tri|Ga|De(Posted 2012) [#2]
I tried to go back to Monkey 1.65 and 1.64b but i still can't compile to GLFW.
I can compile it to iOS but it will not run on the iOS emulator, theres no game icon.

Please help Mark I'm stuck!!!


marksibly(Posted 2012) [#3]
Him,

No idea...everything working fine here on my setup.

It looks like some kind of xcode configuration problem to me - stdlib.h is a standard C include file, and there's no reason xcode shouldn't be able to find it unless there's a problem with xcode itself.

Can you create a new 'empty' project in xcode and build/run it?

[edit]
Ok, you've had this problem before and it was due to SDK versions...

Note: You should NOT have to change the 'Base SDK' setting in 'Build Settings' - this should show 'Current OS X'.

If not, you either haven't deleted your 'blah.build' folder, OR you are using an old 'targets/' directory, OR...?
[/edit]


Tri|Ga|De(Posted 2012) [#4]
I can create new Mac project and run it okay in Xcode.
When I try to compile my Monkey game in XCode it gave me an error. The error told me to go to preferences/download and install all updates. I did that but I still can't compile it from TED.

If I try to compile it from XCode again then I get a lot of warning.
I did copy the Monkey v1.66 to my Monkey folder. No difference.

I can not compile anything in GLFW any longer.

I'm using Xcode version 4.5.1 (4G1004)

What do I do?


Tri|Ga|De(Posted 2012) [#5]
Okay I deleted Xcode and installed it again. But I still get the same error.

But iOS seems to work now.


marksibly(Posted 2012) [#6]
Hi,

Please email me a zip of the glfw xcode project.


Tri|Ga|De(Posted 2012) [#7]
The mail is send.


TheRedFox(Posted 2012) [#8]
I am using the same XCode. Works okay on iOS sim and actual iPad2 device.

Make sure you delete the .build folder, it gave me error messages until I got rid of it and rebuild. DerivedData may also require some deletions.


Tri|Ga|De(Posted 2012) [#9]
I do delete the build folder but I just can't compile to GLFW anymore.
iOS is working okay as is html5.

I think the error message is the same as one I got earlier. That error could be corrected by changing the SDK number in Xcode. But this has absolutely no effect now.


TheRedFox(Posted 2012) [#10]
Well, don't know about your system but GLFW works here (just compiled fine right now - debug mode tough)
OSX Lion, not Mountain Lion if that makes any difference.


Tri|Ga|De(Posted 2012) [#11]
I'm on mountain Lion with Xcode version 4.5.1 (4G1004).


Tri|Ga|De(Posted 2012) [#12]
So I deletede the MonkeyPro folder and copied all files from v66 to MonkeyPro folder.
Deletede XCode and all the other Xcode folders I could find.
Reinstalled Xcode.

Now I can compile to GLFW, but only in Debug mode.
But thats okay, at least I can compile to GLFW now.

Thanks to Mark for you hints.


Leo Santos(Posted 2012) [#13]
I'm having similar issues. Brand new Mac OS 10.8.2, plus recently installed Xcode from the App Store.

Compiles just fine to Debug (despite lots of warnings), but fails when compiling to Release code.

Thanks,
Leo.


marksibly(Posted 2012) [#14]
Hi,

Are you getting the same error? ie:

../glfw/lib/internal.h:58:10: fatal error: 'stdlib.h' file not found

Have you installed 'command line tools' via xcode->preferences->downloads? This shouldn't be necessary, but I'm just guessing now...


Leo Santos(Posted 2012) [#15]
I installed the command line tools, no change. The error I get in the console is:


TRANS FAILED: TRANS Failed to execute 'xcodebuild -configuration Release', return code=16640


If I go to the terminal and run 'xcodebuild -configuration Release' inside the xcode folder under the build folder I get:


The following build commands failed:
CompileC build/MonkeyGame.build/Release/MonkeyGame.build/Objects-normal/i386/cocoa_window.o ../glfw/lib/cocoa/cocoa_window.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler


Doing 'xcodebuild -configuration Debug' compiles successfully.
I also tried using Monkey 64b, and that worked fine! Problem happens in 66 only.

Hope that helps!
Leo.


marksibly(Posted 2012) [#16]
Hi,

Can you email me a zip of a failing project, including the .build folder?

Also, can you try these from the cmd line and let me know what the output is?

xcodebuild -version

xcode-select -print-path

Also, what version of xcode does xcode think it's running?


marksibly(Posted 2012) [#17]
Hi,

Turns out this is a GLFW bug - weird that it only causes a warning in debug builds though.

Fixed in v67b.