Xcode 4 - clang error
Asked Answered
U

7

15

I'm migrating from Xcode 3.5 to Xcode 4 and while I'm trying to Archiving my app for AdHoc distribution.
I received this error

Precompile MyApp_Prefix.pch

ProcessPCH /Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/Build/PrecompiledHeaders/MyApp_Prefix-crxrbmeralwexyefvuwvzexquuin/MyApp_Prefix.pch.pth MyApp_Prefix.pch normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/return/Projects/iphone-MyApp
setenv LANG en_US.US-ASCII
setenv PATH "/Xcode4.2/Platforms/iPhoneOS.platform/Developer/usr/bin:/Xcode4.2/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Xcode4.2/Platforms/iPhoneOS.platform/Developer/usr/bin/clang -x objective-c-header -arch armv7 -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -std=c99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-shorten-64-to-32 -DFAVOURITES_ENABLED=0 -isysroot /Xcode4.2/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -gdwarf-2 -fvisibility=hidden -Wno-sign-conversion -mthumb "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -miphoneos-version-min=3.0 -iquote "/Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/ArchiveIntermediates/MyApp - Distribution/IntermediateBuildFilesPath/MyApp.build/Distribution-iphoneos/MyApp.build/MyApp-generated-files.hmap" "-I/Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/ArchiveIntermediates/MyApp - Distribution/IntermediateBuildFilesPath/MyApp.build/Distribution-iphoneos/MyApp.build/MyApp-own-target-headers.hmap" "-I/Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/ArchiveIntermediates/MyApp - Distribution/IntermediateBuildFilesPath/MyApp.build/Distribution-iphoneos/MyApp.build/MyApp-all-target-headers.hmap" -iquote "/Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/ArchiveIntermediates/MyApp - Distribution/IntermediateBuildFilesPath/MyApp.build/Distribution-iphoneos/MyApp.build/MyApp-project-headers.hmap" "-I/Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/ArchiveIntermediates/MyApp - Distribution/BuildProductsPath/Distribution-iphoneos/include" "-I”/Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/ArchiveIntermediates/MyApp" -I- "-IDistribution/BuildProductsPath/Distribution-iphoneos/../three20″" "-I“/Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/ArchiveIntermediates/MyApp" -I- "-IDistribution/BuildProductsPath/Distribution-iphoneos/../../three20″" -Ithree20/Build/Products/three20 -I/Xcode4.2/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/include/libxml2 "-I/Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/ArchiveIntermediates/MyApp - Distribution/IntermediateBuildFilesPath/MyApp.build/Distribution-iphoneos/MyApp.build/DerivedSources/armv7" "-I/Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/ArchiveIntermediates/MyApp - Distribution/IntermediateBuildFilesPath/MyApp.build/Distribution-iphoneos/MyApp.build/DerivedSources" "-F/Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/ArchiveIntermediates/MyApp - Distribution/BuildProductsPath/Distribution-iphoneos" -c /Users/return/Projects/iphone-MyApp/MyApp_Prefix.pch -o /Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/Build/PrecompiledHeaders/MyApp_Prefix-crxrbmeralwexyefvuwvzexquuin/MyApp_Prefix.pch.pth -MMD -MT dependencies -MF /Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/Build/PrecompiledHeaders/MyApp_Prefix-crxrbmeralwexyefvuwvzexquuin/MyApp_Prefix.pch.d


**clang: error: '-I-' not supported, please use -iquote instead**
**Command /Xcode4.2/Platforms/iPhoneOS.platform/Developer/usr/bin/clang failed with exit code 1**

Do you know what I should do to fix this?


UPDATE (report result after followed MacMade's suggestions)

So in the Target Build Settings:
I have nothing in Other C flags.
I have nothing in User Header Search Paths

In Header Search Paths, I have:

  • ”$(BUILT_PRODUCTS_DIR)/../three20″
  • “$(BUILT_PRODUCTS_DIR)/../../three20″
  • ./three20/Build/Products/three20
  • /usr/include/libxml2

but I'm not sure what to change here.

In Compiler for C/C++/Objective-C setting, I switched from Apple LLVM compiler to LLVM GCC and get this message:

cc1obj: note: obsolete option -I- used, please use -iquote instead  
cc1obj: error: -I- specified twice  
cc1obj: note: obsolete option -I- used, please use -iquote instead 

UPDATE (report result after followed MacMade's updated suggestions)

So I move:

  • ”$(BUILT_PRODUCTS_DIR)/../three20″
  • “$(BUILT_PRODUCTS_DIR)/../../three20″

to User Header Search Paths

and it works!!!
(NOTE: I don't move ./three20/Build/Products/three20 because I see
can't find <Three20/Three20.h>
errors while building the project if I do.)

Unguentum answered 28/11, 2011 at 20:5 Comment(3)
I had this problem too, and found XCode was very finicky. It only worked if I followed what Tuyen Nguyen did EXACTLY -- move the paths that start with $(BUILT_PRODUCTS_DIR) to User Header Search Paths and leave the others where they are.Bregenz
I had the problem when I mistook header search path with other C flags... aaarrg!Gary
In my case in GCC_PREPROCESSOR_DEFINITIONS i have "'$(inherited)'" problem was with single quotes when inherited variable was simply emptyChuck
S
5

Apparently, you've set custom compiler flags for the include paths.

Go to your target's build settings and check this option:

  • Other C flags

If you have something in it, you may replace it by the -iquote version.

Otherwise, still in the build settings, check the value of the following options:

  • Header Search Paths
  • User Header Search Paths

Try to manipulate these values, if applicable.

Otherwise, you may also continue to use GCC as a fronted, instead of Clang.

You can do this by setting the Compiler for C/C++/Objective-C build setting to LLVM GCC instead of Apple LLVM compiler.

EDIT

Based on your edit, I can see you are using the Three20 library.

Depending on how you include that stuff, you may want to put these search paths to the User Header Search Paths, instead of Header search paths (if you include them with "" instead of <>).
Try to do this for Three20, but leave libxml here...

Starchy answered 28/11, 2011 at 20:36 Comment(1)
For me, someone had put SrcRoot in the header search paths. Removing that worked. Odd thing is it built on one machine and not another.Fridell
R
1

I tried these solutions. But i couldn't or not working for me.
I solved this problem with this way:

I deleted MuseumTests in targets
When you clicked your project in general tab on left there is targets

xcode project general general tab

Remise answered 23/5, 2015 at 7:35 Comment(0)
S
1

You can solve this problem by selecting General tab of AppNameTests and select your app from the drop down list and enable "Allow testing Host Applications APIs"

Solidary answered 21/7, 2015 at 3:51 Comment(0)
C
0

I just had this problem with an instagram lib, my mistake was that i was importing the files to a target and compiled the other target. It gave me some headaches.

Crabby answered 4/5, 2013 at 7:33 Comment(0)
S
0

Hi guys we did something that worked... We had the same problem and it was quite easy to solve... First you go to terminal type cd cd (drag the whole folder where your file is in) and press return

after you are inside the folder you have to write:

pod instal and type return

something like that....

Last login: Wed Aug 21 09:19:29 on console

WozMac1:~ KrisBasque$ WozMac1:~ KrisBasque$ WozMac1:~ KrisBasque$ WozMac1:~ KrisBasque$ cd WozMac1:~ KrisBasque$ cd /Users/KrisBasque/Documents/QUADDRO/medapp WozMac1:medapp KrisBasque$ pod install Analyzing dependencies

CocoaPods 0.23.0 is available.

Downloading dependencies Using AFNetworking (1.3.1) Installing FMDB (2.1) Using MBProgressHUD (0.7) Using PSStackedView (1.0) Using Reachability (3.1.1) Installing SDWebImage (3.3) Using TapkuLibrary (0.2.4) Installing libwebp (0.3.0-rc7) Generating Pods project Integrating client project WozMac1:medapp KrisBasque$

Swede answered 21/8, 2013 at 20:30 Comment(0)
W
0

The way I solved this was my making sure no other implementation files we're linked to your file. Linking interface files is fine though

Wideopen answered 12/11, 2013 at 7:54 Comment(0)
P
0

This error also caused by wrong header import.

For example your class is "yourclass.h", but in wrong way if you import "yourclass.m" it is cause this error.

Pedal answered 5/1, 2016 at 9:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.