0

请看这张取自 xcode 的图片:

在此处输入图像描述

这些似乎与我在名为 Global.h 的文件中定义的全局变量有关

但我认为 Global.h 没有任何问题,那么为什么会出现这些错误?

这是构建日志:

Ld /Users/zak/Library/Developer/Xcode/DerivedData/Kidsfridge-    amcsbtrvmfjdgoapuiabisqnzsze/Build/Intermediates/ArchiveIntermediates/Kidsfridge/IntermediateB    uildFilesPath/Kidsfridge.build/Adhoc-iphoneos/Kidsfridge.build/Objects-    normal/armv7/Kidsfridge normal armv7  
    cd "/Users/zak/Downloads/Kidsfridge20120302_1 2/Kidsfridge"  
    setenv IPHONEOS_DEPLOYMENT_TARGET 4.2  
    setenv PATH       "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/App    lications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"  
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -    arch armv7 -isysroot          /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS    5.1.sdk -L/Users/zak/Library/Developer/Xcode/DerivedData/Kidsfridge-    amcsbtrvmfjdgoapuiabisqnzsze/Build/Intermediates/ArchiveIntermediates/Kidsfridge/BuildProductsPath/Adhoc-iphoneos "-L/Users/zak/Downloads/Kidsfridge20120302_1     2/Kidsfridge/Twitter/Twitter+OAuth/Libraries & Headers" -  F/Users/zak/Library/Developer/Xcode/DerivedData/Kidsfridge-  amcsbtrvmfjdgoapuiabisqnzsze/Build/Intermediates/ArchiveIntermediates/Kidsfridge/BuildProductsPath/Adhoc-iphoneos -filelist /Users/zak/Library/Developer/Xcode/DerivedData/Kidsfridge-amcsbtrvmfjdgoapuiabisqnzsze/Build/Intermediates/ArchiveIntermediates/Kidsfridge/IntermediateBuildFilesPath/Kidsfridge.build/Adhoc-iphoneos/Kidsfridge.build/Objects-normal/armv7/Kidsfridge.LinkFileList -dead_strip -miphoneos-version-min=4.2 -framework CoreLocation -framework CoreMedia -framework AssetsLibrary -framework ImageIO -framework MobileCoreServices -framework CFNetwork -lz -lxml2 -framework Foundation -framework UIKit -framework CoreGraphics -framework QuartzCore -framework MessageUI -framework SystemConfiguration -framework Security -lsqlite3 -lOAuth -o /Users/zak/Library/Developer/Xcode/DerivedData/Kidsfridge-amcsbtrvmfjdgoapuiabisqnzsze/Build/Intermediates/ArchiveIntermediates/Kidsfridge/IntermediateBuildFilesPath/Kidsfridge.build/Adhoc-iphoneos/Kidsfridge.build/Objects-normal/armv7/Kidsfridge



ld: warning: alignment lost in merging tentative definition _isAlreadyAdded  
ld: warning: alignment lost in merging tentative definition _isSearching
Undefined symbols for architecture armv7:  
  "_isFavorite", referenced from:  
      -[ArtworkViewController tableView:didSelectRowAtIndexPath:] in ArtworkViewController.o  
      -[ArtworkThumbNailView reloadScrollView] in ArtworkThumbNailView.o  
      -[ArtworkThumbNailView LoadData] in ArtworkThumbNailView.o  
      -[ArtworkThumbNailView viewDidLoad] in ArtworkThumbNailView.o  
      -[ArtworkImageViewController LoadFullImageArray] in ArtworkImageViewController.o  
      -[ArtworkImageViewController viewWillAppear:] in ArtworkImageViewController.o  
      -[ArtworkImageViewController viewDidLoad] in ArtworkImageViewController.o  
      ...  
ld: symbol(s) not found for architecture armv7  
clang: error: linker command failed with exit code 1 (use -v to see invocation)
4

2 回答 2

1

我用附加到我的 appDelegate 的属性替换了全局变量,错误就消失了。

于 2012-04-24T03:50:21.773 回答
0

我注意到只有 global.h 文件中的布尔值产生了这个警告,(global.h 文件导入到所有 .m 文件中)

我将 BOOL 更改为 int,所有警告都消失了。

于 2012-06-05T21:44:16.253 回答