Compiling with Xcode 4.3 #26

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

Comments

Projects
None yet
@mattconnolly

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

This comment has been minimized.

Show comment
Hide comment
@ttilley

ttilley Jan 12, 2012

Collaborator

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

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@ttilley

ttilley Jan 12, 2012

Collaborator

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. :-/

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@ttilley

ttilley Jan 12, 2012

Collaborator

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.

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@mattconnolly

mattconnolly Jan 12, 2012

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.

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

This comment has been minimized.

Show comment
Hide comment
@sodabrew

sodabrew Feb 17, 2012

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

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

@zipme

This comment has been minimized.

Show comment
Hide comment
@zipme

zipme 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>

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

This comment has been minimized.

Show comment
Hide comment
@sodabrew

sodabrew Feb 17, 2012

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)

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

This comment has been minimized.

Show comment
Hide comment
@ttilley

ttilley Feb 19, 2012

Collaborator

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.

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@clippit

clippit 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:)

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

This comment has been minimized.

Show comment
Hide comment
@zipme

zipme Feb 20, 2012

@clippit wow, it works, thanks!

zipme commented Feb 20, 2012

@clippit wow, it works, thanks!

@peelman

This comment has been minimized.

Show comment
Hide comment
@peelman

peelman Feb 20, 2012

@clippit that works for me as well. Thanks!

peelman commented Feb 20, 2012

@clippit that works for me as well. Thanks!

@Pihrra

This comment has been minimized.

Show comment
Hide comment
@Pihrra

Pihrra Feb 22, 2012

@clippit worked for me as well thank you !

Pihrra commented Feb 22, 2012

@clippit worked for me as well thank you !

@richardjellis

This comment has been minimized.

Show comment
Hide comment

@clippit And me, thanks!

@stewartmatheson

This comment has been minimized.

Show comment
Hide comment

+1 for @clippit 's solution

@eirkeirkeirk

This comment has been minimized.

Show comment
Hide comment
@eirkeirkeirk

eirkeirkeirk Feb 26, 2012

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

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

@flywhale

This comment has been minimized.

Show comment
Hide comment

@clippit and me!

@joebrumley

This comment has been minimized.

Show comment
Hide comment

thanks @clippit

@zhpengg

This comment has been minimized.

Show comment
Hide comment

zhpengg commented Feb 28, 2012

thanks @clippit

@shomaker

This comment has been minimized.

Show comment
Hide comment
@shomaker

shomaker 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.

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

This comment has been minimized.

Show comment
Hide comment
@neotherapper

neotherapper Mar 9, 2012

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

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

@sodabrew

This comment has been minimized.

Show comment
Hide comment
@sodabrew

sodabrew Mar 9, 2012

No more "me too" comments please!

sodabrew commented Mar 9, 2012

No more "me too" comments please!

@AaronThornton00

This comment has been minimized.

Show comment
Hide comment
@AaronThornton00

AaronThornton00 Mar 16, 2012

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

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

@benwoodward

This comment has been minimized.

Show comment
Hide comment

THANKS @clippit

picard clap

@alhafoudh

This comment has been minimized.

Show comment
Hide comment
@alhafoudh

alhafoudh Apr 29, 2012

*uck yeah! Thanks :) Works @clippit

*uck yeah! Thanks :) Works @clippit

@ralphos

This comment has been minimized.

Show comment
Hide comment
@ralphos

ralphos Apr 30, 2012

Sending thanks to @clippit!

ralphos commented Apr 30, 2012

Sending thanks to @clippit!

@sdball

This comment has been minimized.

Show comment
Hide comment
@sdball

sdball May 8, 2012

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

sdball commented May 8, 2012

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

@hpyhacking

This comment has been minimized.

Show comment
Hide comment
@hpyhacking

hpyhacking May 10, 2012

Thanks to @clippit, but Homebrew need to flowing setting

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

Thanks to @clippit, but Homebrew need to flowing setting

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

This comment has been minimized.

Show comment
Hide comment
@jmohsenin

jmohsenin May 13, 2012

@clippit you're the man.

@clippit you're the man.

@wprater

This comment has been minimized.

Show comment
Hide comment
@wprater

wprater May 16, 2012

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

wprater commented May 16, 2012

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

@rahul286

This comment has been minimized.

Show comment
Hide comment
@rahul286

rahul286 May 29, 2012

@clippit Thanks a ton! :-)

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

@clippit Thanks a ton! :-)

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

@oliverbarreto

This comment has been minimized.

Show comment
Hide comment
@oliverbarreto

oliverbarreto Jun 26, 2012

thanks for this answer !!!

thanks for this answer !!!

@newtriks

This comment has been minimized.

Show comment
Hide comment
@newtriks

newtriks Jul 10, 2012

Word @clippit you da man!

Word @clippit you da man!

@ramonrails

This comment has been minimized.

Show comment
Hide comment
@ramonrails

ramonrails Jul 21, 2012

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

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

This comment has been minimized.

Show comment
Hide comment
@Merovex

Merovex 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.

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