繁体   English   中英

Xcode 4 - 铿锵错误

[英]Xcode 4 - clang error

我正在从Xcode 3.5迁移到Xcode 4,而我正在尝试存档我的应​​用程序以进行AdHoc分发。
我收到了这个错误

预编译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**

你知道我应该怎么做才能解决这个问题吗?


更新(遵循MacMade建议后的报告结果)

所以在目标构建设置中
其他C标志中没有任何内容。
用户标题搜索路径中没有任何内容

标题搜索路径中 ,我有:

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

但我不知道这里要改变什么。

Compiler for C / C ++ / Objective-C设置中,我从Apple LLVM compiler切换到LLVM GCC并收到以下消息:

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 

更新(遵循MacMade更新建议后的报告结果)

所以我动了:

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

用户标题搜索路径

它的工作原理!!!
(注意:我不会移动./three20/Build/Products/three20因为我看到了
can't find <Three20/Three20.h>
如果我这样做,那么在构建项目时会出错。)

显然,您已为包含路径设置自定义编译器标志。

转到目标的构建设置并选中此选项:

  • 其他C标志

如果你有东西,你可以用-iquote版本替换它。

否则,仍在构建设置中,检查以下选项的值:

  • 标题搜索路径
  • 用户标题搜索路径

如果适用,尝试操纵这些值。

否则,您也可以继续使用GCC作为前端而不是Clang。

您可以通过将Compiler for C / C ++ / Objective-C构建设置设置为LLVM GCC而不是Apple LLVM编译器来完成此操作

编辑

根据您的编辑,我可以看到您正在使用Three20库。

根据您包含这些内容的方式,您可能希望将这些搜索路径放在用户标题搜索路径中 ,而不是标题搜索路径 (如果您使用""而不是<>包含它们)。
尝试为Three20做这个,但是在这里留下libxml ...

我试过这些解决方案。 但我不能或不能为我工作。
我用这种方式解决了这个问题:

我删除了目标中的MuseumTests
当您在左侧的常规选项卡中单击项目时,会有目标

xcode项目一般常规选项卡

您可以通过选择AppNameTests的 常规选项卡并从下拉列表中选择您的应用程序并启用“ 允许测试主机应用程序API ”来解决此问题

我刚刚使用Instagram lib遇到此问题,我的错误是我将文件导入目标并编译了另一个目标。 这让我有些头疼。

嗨,大家好,我们做了一些有用的东西......我们遇到了同样的问题而且很容易解决......首先你去终端类型cd cd(拖动文件所在的整个文件夹)然后按返回

在你必须写的文件夹内:

pod安装和类型返回

类似的东西....

上次登录时间:8月21日星期三09:19:29在控制台上

WozMac1:~KrisBasque $ WozMac1:~KrisBasque $ WozMac1:~KrisBasque $ WozMac1:~KrisBasque $ cd WozMac1:~KrisBasque $ cd / Users / KrisBasque / Documents / QUADDRO / medapp WozMac1:medapp KrisBasque $ pod install分析依赖关系

CocoaPods 0.23.0可用。

下载依赖项使用AFNetworking(1.3.1)使用MBProgressHUD安装FMDB(2.1)(0.7)使用PSStackedView(1.0)使用可访问性(3.1.1)使用TapkuLibrary安装SDWebImage(3.3)(0.2.4)安装libwebp(0.3.0- rc7)生成Pods项目集成客户端项目WozMac1:medapp KrisBasque $

我解决这个问题的方法是确保我们没有其他实现文件链接到您的文件。 链接接口文件很好

此错误也是由错误的标头导入引起的。

例如,您的类是“yourclass.h”,但如果导入“yourclass.m”,则错误地导致此错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM