Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling with Xcode 4.3 #26

Closed
mattconnolly opened this issue Jan 12, 2012 · 34 comments
Closed

Compiling with Xcode 4.3 #26

mattconnolly opened this issue Jan 12, 2012 · 34 comments

Comments

@mattconnolly
Copy link

If you're an Apple developer and have access to the preview release of Xcode 4.3, you will find that this gem fails to compile 'fsevent/fsevent_watch.c' with the following error:

Building native extensions.  This could take a while...
ERROR:  Error installing rb-fsevent:
    ERROR: Failed to build gem native extension.

        /Users/matt/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb
creating Makefile
CFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -mdynamic-no-pic -std=gnu99 -Os -pipe -Wmissing-prototypes -Wreturn-type -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wunused-parameter -Wunused-variable -Wunused-value -Wuninitialized -Wunknown-pragmas -Wshadow -Wfour-char-constants -Wsign-compare -Wnewline-eof -Wconversion -Wshorten-64-to-32 -Wglobal-constructors -pedantic' /usr/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -mdynamic-no-pic -std=gnu99 -dead_strip -framework CoreServices -o '/Users/matt/.rvm/gems/ruby-1.9.3-p0/gems/rb-fsevent-0.4.3.1/bin/fsevent_watch' fsevent/fsevent_watch.c
fsevent/fsevent_watch.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^
1 error generated.
extconf.rb:59:in `<main>': Compilation of fsevent_watch failed (see README) (RuntimeError)

I'm guessing it's due to the changes to install locations with Xcode 4.3.... (but don't have the time to look further into it at this point - sorry).

@ttilley
Copy link
Member

ttilley commented Jan 12, 2012

If you read the notes on 4.3, you'll see that it's a known issue. The unix bits have been completely ignored. Let's see if I can find the exact wording...

Sent from my iPhone

On Jan 12, 2012, at 5:22 AM, Matt Connollyreply@reply.github.com wrote:

If you're an Apple developer and have access to the preview release of Xcode 4.3, you will find that this gem fails to compile 'fsevent/fsevent_watch.c' with the following error:

Building native extensions. This could take a while...
ERROR: Error installing rb-fsevent:
ERROR: Failed to build gem native extension.

   /Users/matt/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb

creating Makefile
CFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -mdynamic-no-pic -std=gnu99 -Os -pipe -Wmissing-prototypes -Wreturn-type -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wunused-parameter -Wunused-variable -Wunused-value -Wuninitialized -Wunknown-pragmas -Wshadow -Wfour-char-constants -Wsign-compare -Wnewline-eof -Wconversion -Wshorten-64-to-32 -Wglobal-constructors -pedantic' /usr/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -mdynamic-no-pic -std=gnu99 -dead_strip -framework CoreServices -o '/Users/matt/.rvm/gems/ruby-1.9.3-p0/gems/rb-fsevent-0.4.3.1/bin/fsevent_watch' fsevent/fsevent_watch.c
fsevent/fsevent_watch.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^
1 error generated.
extconf.rb:59:in `

': Compilation of fsevent_watch failed (see README) (RuntimeError)

I'm guessing it's due to the changes to install locations with Xcode 4.3.... (but don't have the time to look further into it at this point - sorry).


Reply to this email directly or view it on GitHub:
#26

@ttilley
Copy link
Member

ttilley commented Jan 12, 2012

Note on unix userspace tools:

Note: 
This preview release does not include Unix development tools placed into /usr. 
To perform makefilebased and config-based builds, either install Xcode 4.2.1 or 
use xcrun to execute the tools provided within Xcode

Further down, a note that also says the unix headers aren't installed to the system:

Build failures against Current Mac OS
Xcode 4.3 developer preview 3 does not include Unix development tools and headers. 
This includes headers in /System/Library/Frameworks. If a project specifies Current 
Mac OS as its SDK and an earlier version of Xcode is not installed, the project fails 
to build.
Workaround: Either install Xcode 4.2.1 or change the project to build with the Latest 
OS X SDK

...which I guess means that I should potentially switch from "current" to "latest" as the SDK target. You'll still have problems compiling any standard unix software outside of xcode though. :-/

@ttilley
Copy link
Member

ttilley commented Jan 12, 2012

Since it's listed as a "known issue" and not an upgrade note, I'm expecting this to be something they resolve before 4.3 is finalized.

@mattconnolly
Copy link
Author

Thanks for this info - may help others who encounter the same issue.

I have both 4.2.1 and 4.3 preview installed, but it was building against 4.3.

For others who have both installed and encounter this issue, you need to "select" which Xcode to use, with the following command:

$ sudo xcode-select -switch /Developer

Then the gem installs correctly. Don't forget to change it back if you want to use 4.3 preview again after.

@sodabrew
Copy link

Better solution: install "Command Line Tools"
https://developer.apple.com/downloads/index.action?name=for%20Xcode
(May require login)

@zipme
Copy link

zipme commented Feb 17, 2012

I installed the xcode 4.3 as well as the "Command Line Tools", still got the error:
creating Makefile
CFLAGS='-isysroot /Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -mdynamic-no-pic -std=gnu99 -Os -pipe -Wmissing-prototypes -Wreturn-type -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wunused-parameter -Wunused-variable -Wunused-value -Wuninitialized -Wunknown-pragmas -Wshadow -Wfour-char-constants -Wsign-compare -Wnewline-eof -Wconversion -Wshorten-64-to-32 -Wglobal-constructors -pedantic' /usr/bin/clang -isysroot /Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -mdynamic-no-pic -std=gnu99 -dead_strip -framework CoreServices -o '/Users/genki/.rvm/gems/ruby-1.9.3-p0-perf/gems/rb-fsevent-0.4.3.1/bin/fsevent_watch' fsevent/fsevent_watch.c
fsevent/fsevent_watch.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>

@sodabrew
Copy link

Yep, I was wrong there. Apple no longer supplies a non-llvm GCC,and
headers are nowhere to be found, so you need the package from here
after all:

https://github.com/kennethreitz/osx-gcc-installer

On Feb 17, 2012, at 8:03 AM, Gk
reply@reply.github.com
wrote:

I installed the xcode 4.3 as well as the "Command Line Tools", still got the error:
creating Makefile
CFLAGS='-isysroot /Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -mdynamic-no-pic -std=gnu99 -Os -pipe -Wmissing-prototypes -Wreturn-type -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wunused-parameter -Wunused-variable -Wunused-value -Wuninitialized -Wunknown-pragmas -Wshadow -Wfour-char-constants -Wsign-compare -Wnewline-eof -Wconversion -Wshorten-64-to-32 -Wglobal-constructors -pedantic' /usr/bin/clang -isysroot /Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -mdynamic-no-pic -std=gnu99 -dead_strip -framework CoreServices -o '/Users/genki/.rvm/gems/ruby-1.9.3-p0-perf/gems/rb-fsevent-0.4.3.1/bin/fsevent_watch' fsevent/fsevent_watch.c
fsevent/fsevent_watch.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>


Reply to this email directly or view it on GitHub:
#26 (comment)

@ttilley
Copy link
Member

ttilley commented Feb 19, 2012

I believe you need to xcode-select -switch /usr/bin ?

Note that with xcode 4.4, which has a UI for installing the command line tools package from within xcode, everything just works. Perhaps the next 4.3 developer preview will include additional support and fixes that bring it in line with 4.4.

@clippit
Copy link

clippit commented Feb 20, 2012

I'm using Xcode 4.3 and set

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/

It built successfully. Hope this helps:)

@zipme
Copy link

zipme commented Feb 20, 2012

@clippit wow, it works, thanks!

@peelman
Copy link

peelman commented Feb 20, 2012

@clippit that works for me as well. Thanks!

@Pihrra
Copy link

Pihrra commented Feb 22, 2012

@clippit worked for me as well thank you !

@richardjellis
Copy link

@clippit And me, thanks!

@stewartmatheson
Copy link

+1 for @clippit 's solution

@ghost
Copy link

ghost commented Feb 26, 2012

@clippit ’s solution worked for me as well! Only wasted a few hours on this :) Thank you!

@flywhale
Copy link

@clippit and me!

@joebrumley
Copy link

thanks @clippit

1 similar comment
@zhpengg
Copy link

zhpengg commented Feb 28, 2012

thanks @clippit

@shomaker
Copy link

shomaker commented Mar 1, 2012

yay @clippit - worked for me. Before finding this comment I had guessed just switching to /Applications/Xcode.app/, but the full path down to Contents/.../Developer is required.

@neotherapper
Copy link

thanks @clippit it also worked for me sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/

@sodabrew
Copy link

sodabrew commented Mar 9, 2012

No more "me too" comments please!

@AaronThornton00
Copy link

Just one more, I cant resist. Clip it, you rock.

@benwoodward
Copy link

THANKS @clippit

picard clap

@alhafoudh
Copy link

*uck yeah! Thanks :) Works @clippit

@ralphos
Copy link

ralphos commented Apr 30, 2012

Sending thanks to @clippit!

@sdball
Copy link

sdball commented May 8, 2012

No seriously, I didn't expect it to work but @clippit saved the day.

@hpyhacking
Copy link

Thanks to @clippit, but Homebrew need to flowing setting

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

@jmohsenin
Copy link

@clippit you're the man.

@wprater
Copy link

wprater commented May 16, 2012

@clippit Can you explain why the alternate path? Is there a non-llvm gcc compiler in that path?

@rahul286
Copy link

@clippit Thanks a ton! :-)

p.s. this may annoy some but can't control my urge to thank @clippit

@oliverbarreto
Copy link

thanks for this answer !!!

@newtriks
Copy link

Word @clippit you da man!

@ramonrails
Copy link

I just want some things to "simply work" while I focus on my ruby/rails development. This is one. Definitely calls for a thanking to @clippit

@Merovex
Copy link

Merovex commented Sep 26, 2012

Ran into this problem... the solution above did not work. But, the software I was running seemed to want to install an earlier version...I forced it to load the more recent version and all is now right with the world.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests