0

See this image a took from xcode:

enter image description here

These seem to be related to global variables I am defining in a file called Global.h

But I see nothing wrong with Global.h so why am I getting these errors?

Here is the build log:

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)
zakdances
  • 22,285
  • 32
  • 102
  • 173
  • 2
    Try to post the build log, not the Xcode error table. – CodaFi Apr 14 '12 at 19:49
  • possible duplicate of [iOS alignment lost in merging tentative definition](http://stackoverflow.com/questions/8743262/ios-alignment-lost-in-merging-tentative-definition) – Till Apr 14 '12 at 19:56
  • I posted the build log, and this [post](http://stackoverflow.com/questions/8743262/ios-alignment-lost-in-merging-tentative-definition) doesn't answer the question (solution doesn't work) plus its a different issue as my issue is warnings combined with errors. – zakdances Apr 14 '12 at 20:02
  • @CodaFi Does that build log suffice? – zakdances Apr 14 '12 at 20:14
  • @CodaFi done. Hopefully that's more readable. – zakdances Apr 14 '12 at 20:51
  • 1
    How about [this](http://stackoverflow.com/questions/8897543/apple-mach-o-linker-warning) question? The answer's definitely more informative. – CodaFi Apr 14 '12 at 21:02
  • I agree about avoiding global vars, but unfortunately I'm working with someone else's code and it's my task to debug it. – zakdances Apr 14 '12 at 21:37
  • 2
    The problem you posted and that I marked as a dupe actually has the very same root and I highly doubt that you followed the hints given by that accepted answer. I bet that you simply include a header that is defining AND declaring some global variables (bad style anyways) within multiple sources and that is not possible for obvious reasons. To fix that, you will have to declare in that header using the extern keyword and define within an implementation (m) -file. – Till Apr 14 '12 at 21:38

2 Answers2

1

I replaced the global variables with properties attached to my appDelegate and the errors went away.

zakdances
  • 22,285
  • 32
  • 102
  • 173
0

I noticed only my Booleans in a global.h file produced this warning, (global.h file imported into all .m files)

i changed BOOL to int, and all warnings went away.

hokkuk
  • 675
  • 5
  • 21