title: Undefined symbols error while building PhoneGap under Xcode 4?
body: <p>I'm trying to build a PhoneGap-based application using Xcode 4. Since there's no PhoneGap project template for Xcode 4, I used <a href="https://build.phonegap.com/generate" rel="nofollow">the handy web page</a> to create the project. However, I'm getting the following error when I build:</p>
  
  <pre><code>Undefined symbols for architecture armv7:
    "_OBJC_METACLASS_$_PhoneGapDelegate", referenced from:
        _OBJC_METACLASS_$_TestAppDelegate in TestAppDelegate.o
    "_OBJC_CLASS_$_PhoneGapDelegate", referenced from:
        _OBJC_CLASS_$_TestAppDelegate in TestAppDelegate.o
  ld: symbol(s) not found for architecture armv7
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>The bulk of the Cocoa Touch code for a PhoneGap app is built as a library called PhoneGapLib. The application project references the PhoneGapLib project and depends on and links with its product, PhoneGapLib.a. PhoneGapDelegate is defined in PhoneGapLib; TestAppDelegate is defined in the main project. I've set the Valid Architectures setting for both the main project and the PhoneGapLib project to "armv6 armv7 i386".</p>
  
  <p>I don't know what's causing the error above. Can anyone decipher it and tell me which build settings I should be looking at to resolve it?</p>
  
  <p>I found <a href="http://groups.google.com/group/phonegap/browse_thread/thread/544f44883f9e22b6" rel="nofollow">a Google Groups thread</a> in which the author solves a similar problem by using lipo to manually combine different builds of the library. I'd really like to avoid that step if possible -- this seems like something that I should be able to accomplish with the right combination of build settings in the two projects.</p>
  
  <p>Thanks for your help!</p>