Soheil
Soheil

Reputation: 795

Why does Xcode fail to compile when opened from command line?

I get this build error

i686-apple-darwin11-gcc-4.2.1: /Users/soheil/Library/Developer/Xcode/DerivedData/Get_iPlayer_GUI-fqsfzttzsuikevhdogsnxnjaddjn/Build/Intermediates/PrecompiledHeaders/Get_iPlayer GUI_Prefix-hggnypajoaggzffgvymocdlipqdj/Get_iPlayer GUI_Prefix.pch.dia: No such file or directory

cc1obj: error: unrecognized command line option "-Wno-implicit-atomic-properties"
cc1obj: error: unrecognized command line option "-Wno-receiver-is-weak"
cc1obj: error: unrecognized command line option "-Wno-deprecated-implementations"
cc1obj: error: unrecognized command line option "-Wno-sign-conversion"
cc1obj: error: unrecognized command line option "-fserialize-diagnostics"
Command /usr/bin/gcc-4.2 failed with exit code 1

when opening some xcode projects from command line like

open Get_iPlayer\ GUI.xcodeproj/

Any ideas?

Upvotes: 2

Views: 1059

Answers (2)

jochen
jochen

Reputation: 3920

I had the same problem, and for me the reason was that I set the CC environment variable to "gcc" in my shell startup files. Starting Xcode as follows works for me:

unset CC
open fast-dm.xcodeproj

If I only give the second command, compilation in Xcode fails with error messages very similar to the ones you saw.

Upvotes: 2

Kjuly
Kjuly

Reputation: 35131

Try this one:

open -a Xcode folder/project.xcode

-a stands for application. Here you open the project with the application Xcode.

Upvotes: 0

Related Questions