重命名 XCode 5.1 项目后出现编译器错误

     2023-03-08     184

关键词:

【中文标题】重命名 XCode 5.1 项目后出现编译器错误【英文标题】:Compiler error after renaming XCode 5.1 project 【发布时间】:2014-07-09 18:29:51 【问题描述】:

我在 XCode 中将一个项目文件从 TopPlaces 重命名为 TopRegions。重命名并清理文件位置和引用后,我可以在 XCode 中“清理”文件而没有任何麻烦,但是当我去编译它时,我得到以下错误。

clang: error: no such file or directory: '/Users/iOSPadawan/Documents/Developer/Stanford iOS 7/TopRegions/TopPlaces/ImageVC.m'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

我尝试删除错误中引用的视图控制器并从原始(预重命名)项目中重新导入它,但这并没有解决错误。

我在 TopPlaces 中对项目的“构建设置”和“构建阶段”进行了文本搜索,但结果一无所获。但是,在 Build Settings 中的 Compile Sources 下,我看到了对旧项目名称的引用(不在文本搜索中出现)。我已经尝试删除它们并重新添加实现文件,但我仍然遇到同样的错误。

我知道我错过了一些非常讨厌的东西,但我不知道是什么?有什么建议么?以下是编译器错误的完整列表:

CompileC /Users/iOSPadawan/Library/Developer/Xcode/DerivedData/TopRegions-euvbevtdsgmfzsbsgnulbhzytzij/Build/Intermediates/TopRegions.build/Debug-iphonesimulator/TopRegions.build/Objects-normal/i386/ImageVC.o TopPlaces/ImageVC.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd "/Users/iOSPadawan/Documents/Developer/Stanford iOS 7/TopRegions"
    export LANG=en_US.US-ASCII
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch i386 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-cache-path=/Users/iOSPadawan/Library/Developer/Xcode/DerivedData/ModuleCache -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk -fexceptions -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -Wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch -mios-simulator-version-min=7.0 -iquote /Users/iOSPadawan/Library/Developer/Xcode/DerivedData/TopRegions-euvbevtdsgmfzsbsgnulbhzytzij/Build/Intermediates/TopRegions.build/Debug-iphonesimulator/TopRegions.build/TopRegions-generated-files.hmap -I/Users/iOSPadawan/Library/Developer/Xcode/DerivedData/TopRegions-euvbevtdsgmfzsbsgnulbhzytzij/Build/Intermediates/TopRegions.build/Debug-iphonesimulator/TopRegions.build/TopRegions-own-target-headers.hmap -I/Users/iOSPadawan/Library/Developer/Xcode/DerivedData/TopRegions-euvbevtdsgmfzsbsgnulbhzytzij/Build/Intermediates/TopRegions.build/Debug-iphonesimulator/TopRegions.build/TopRegions-all-target-headers.hmap -iquote /Users/iOSPadawan/Library/Developer/Xcode/DerivedData/TopRegions-euvbevtdsgmfzsbsgnulbhzytzij/Build/Intermediates/TopRegions.build/Debug-iphonesimulator/TopRegions.build/TopRegions-project-headers.hmap -I/Users/iOSPadawan/Library/Developer/Xcode/DerivedData/TopRegions-euvbevtdsgmfzsbsgnulbhzytzij/Build/Products/Debug-iphonesimulator/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/iOSPadawan/Library/Developer/Xcode/DerivedData/TopRegions-euvbevtdsgmfzsbsgnulbhzytzij/Build/Intermediates/TopRegions.build/Debug-iphonesimulator/TopRegions.build/DerivedSources/i386 -I/Users/iOSPadawan/Library/Developer/Xcode/DerivedData/TopRegions-euvbevtdsgmfzsbsgnulbhzytzij/Build/Intermediates/TopRegions.build/Debug-iphonesimulator/TopRegions.build/DerivedSources -F/Users/iOSPadawan/Library/Developer/Xcode/DerivedData/TopRegions-euvbevtdsgmfzsbsgnulbhzytzij/Build/Products/Debug-iphonesimulator -include /Users/iOSPadawan/Library/Developer/Xcode/DerivedData/TopRegions-euvbevtdsgmfzsbsgnulbhzytzij/Build/Intermediates/PrecompiledHeaders/TopRegions-Prefix-gvxkjoatgnwponegpmitcljtrjli/TopRegions-Prefix.pch -MMD -MT dependencies -MF /Users/iOSPadawan/Library/Developer/Xcode/DerivedData/TopRegions-euvbevtdsgmfzsbsgnulbhzytzij/Build/Intermediates/TopRegions.build/Debug-iphonesimulator/TopRegions.build/Objects-normal/i386/ImageVC.d --serialize-diagnostics /Users/iOSPadawan/Library/Developer/Xcode/DerivedData/TopRegions-euvbevtdsgmfzsbsgnulbhzytzij/Build/Intermediates/TopRegions.build/Debug-iphonesimulator/TopRegions.build/Objects-normal/i386/ImageVC.dia -c /Users/iOSPadawan/Documents/Developer/Stanford\ iOS\ 7/TopRegions/TopPlaces/ImageVC.m -o /Users/iOSPadawan/Library/Developer/Xcode/DerivedData/TopRegions-euvbevtdsgmfzsbsgnulbhzytzij/Build/Intermediates/TopRegions.build/Debug-iphonesimulator/TopRegions.build/Objects-normal/i386/ImageVC.o

【问题讨论】:

【参考方案1】:

由于我不明白的原因,编译器没有更新新项目名称的来源,尽管我在文件检查器中更新了它们的位置。我能够通过在项目导航器中删除引用(不是文件)并从 Finder 中将它们拖回来解决问题。

“经验只是人们给他们的错误起的名字。” ——奥斯卡·王尔德

【讨论】:

重命名项目/工作区后,出现多个“未声明的标识符”错误——但构建良好

】重命名项目/工作区后,出现多个“未声明的标识符”错误——但构建良好【英文标题】:Afterrenamingproject/workspace,multiple\'undeclaredidentifier\'errors--butitbuildsfine【发布时间】:2013-10-1618:04:30【问题描述】:所以我以这种方式重命名... 查看详情

重命名 Visual Studio 2008 MFC 项目后出现 R6034 运行时错误

】重命名VisualStudio2008MFC项目后出现R6034运行时错误【英文标题】:R6034runtimeerrorafterrenamingVisualStudio2008MFCproject【发布时间】:2012-12-1822:46:24【问题描述】:我最近的任务是对我们公司的一种产品进行完全重命名。目前它是在VisualS... 查看详情

重命名用户文件夹后 Xcode 存档错误

】重命名用户文件夹后Xcode存档错误【英文标题】:Xcodearchiveerrorafterrenaminguserfolder【发布时间】:2018-12-1720:04:12【问题描述】:我重命名了Mac的用户文件夹(Users/somename)。这样做后,当尝试提交(存档)应用程序时,我得到:我... 查看详情

Xcode 5.1 和架构 x86_64 的编译错误

...发布时间】:2014-04-1508:27:17【问题描述】:昨天我有一个项目在使用Xcode5时没有问题。今天,在更新到Xcode5.1后,我有6个错误并且项目没有编译。Undefinedsymbolsforarchitecturex86_64:"_OBJC_CLASS_$_PayP 查看详情

Xcode,我如何完全重命名一个项目?

】Xcode,我如何完全重命名一个项目?【英文标题】:Xcode,howdoIrenameentirelyaproject?【发布时间】:2014-04-1209:00:17【问题描述】:我已经重命名了一个Xcode项目,但它的“构建名称”(“SceneKitSession...”)没有改变:你知道怎么改成... 查看详情

Xcode 5.1 更新后使用 segment.io 编译错误

】Xcode5.1更新后使用segment.io编译错误【英文标题】:Compileerrorswithsegment.ioafterXcode5.1update【发布时间】:2014-03-1816:26:09【问题描述】:更新到Xcode5.1后,收到编译错误:Undefinedsymbolsforarchitecturearm64:"_OBJC_CLASS_$_LocalyticsSession",referenced... 查看详情

iphone 项目 - 在 xcode 4.3 中复制和重命名

】iphone项目-在xcode4.3中复制和重命名【英文标题】:iphoneproject-copyandrenameinxcode4.3【发布时间】:2012-06-1605:31:04【问题描述】:我有一个“基础”项目的iphone项目。我想复制这个项目,重命名它并更改几个文件,以便创建我想要... 查看详情

如何在 Xcode 5 中重命名项目?

】如何在Xcode5中重命名项目?【英文标题】:HowdoIrenameaprojectinXcode5?【发布时间】:2013-10-1806:18:48【问题描述】:我需要采取哪些步骤?在过去,这总是一个非常棘手的手动过程。【问题讨论】:【参考方案1】:嗯,答案在Xcode5... 查看详情

在 git 文件重命名后使 Xcode 5 跟随历史

】在git文件重命名后使Xcode5跟随历史【英文标题】:MakeXcode5followhistoryaftergitfilerename【发布时间】:2014-06-0423:32:38【问题描述】:我正在尝试弄清楚如何在使用Xcode时使用git正确重命名文件。我做了一个测试项目,有几个提交,... 查看详情

使用 setDataSource 升级到 Xcode 4.6 后出现编译器错误

】使用setDataSource升级到Xcode4.6后出现编译器错误【英文标题】:CompilererrorafterupgradingtoXcode4.6usingsetDataSource【发布时间】:2013-08-2016:28:36【问题描述】:我正在升级一些项目以使用Xcode4.6和ClangLLVM编译器,但我遇到了一个错误。我... 查看详情

重命名 xcode 项目

】重命名xcode项目【英文标题】:Renamexcodeproject【发布时间】:2014-05-1415:27:00【问题描述】:在我所有的愚蠢中,我注意到我拼错了我自己的项目。由于某些文件路径引用了现在不存在的文件夹,我真的很害怕在Mac中重命名它。... 查看详情

Xcode 6如何重命名复制的目标

】Xcode6如何重命名复制的目标【英文标题】:Xcode6howtorenamecopiedtarget【发布时间】:2014-12-0323:36:54【问题描述】:我知道这不是一个新问题,但我尝试了许多解决方案,例如手动编辑Xcode项目文件或在重命名后为目标重新创建新... 查看详情

SpriteKit NSTimeInterval 重命名

】SpriteKitNSTimeInterval重命名【英文标题】:SpriteKitNSTimeIntervalrenamed【发布时间】:2018-07-0211:30:11【问题描述】:我正在尝试在我的项目中使用SpriteKit,但在我安装它并打开项目后,我收到28个错误。我试图将“NSTimeInterval”重命名... 查看详情

复制 Xcode 项目 - 重命名桥接头

】复制Xcode项目-重命名桥接头【英文标题】:DuplicatingXcodeproject-Renamingbridgingheader【发布时间】:2015-12-2208:15:46【问题描述】:我遵循了DuplicateandrenameXcodeproject&associatedfolders中的建议它工作,除了仍然需要旧项目名称作为前缀... 查看详情

复制 Xcode 项目 - 重命名桥接头

】复制Xcode项目-重命名桥接头【英文标题】:DuplicatingXcodeproject-Renamingbridgingheader【发布时间】:2015-12-2208:15:46【问题描述】:我遵循了DuplicateandrenameXcodeproject&associatedfolders中的建议它工作,除了仍然需要旧项目名称作为前缀... 查看详情

将 Xcode 从 5.0 更新到 5.1 后生成错误

...我将Xcode版本从5.0更新到5.1。在5.0版中,构建过程中没有出现任何问题。但是更新到5.1后,出现以下错误:ld:librarynotfoundfor-lPodsclang:error:link 查看详情

重命名后新的 PhoneGap / Cordova iOS 项目将无法运行

】重命名后新的PhoneGap/CordovaiOS项目将无法运行【英文标题】:NewPhoneGap/CordovaiOSprojectwon\'trunafterrenaming【发布时间】:2013-08-1609:51:03【问题描述】:当您创建一个新的Cordova项目时,它称为HelloCordova,这也是应用程序图标的名称。... 查看详情

Xcode 5.1 未使用的常量被视为错误

...:自从今天早上升级到Xcode5.1后,由于未使用const,我在项目中包含的C++库无法构建。我将警告视为错误:否和迂腐警告:否有什么想法吗?请求行后编辑!:constintNPT_SSDP_MAX_LINE_SIZE=2048;完整的警告是:Shell 查看详情