error:""_OBJC_METACLASS_$_CDVViewController", referenced from:" in Xcode4.3

kannan picture kannan · Sep 26, 2012 · Viewed 8.4k times · Source

I am new to iphone develop and phonegap also. Now i want to create simple iphone app using phonegap. Now i am using phonegap2.0 in lion mac. MY Xcode version is 4.3. Now my issue is after install the phonegap2.0 in xcode when i run the Xcode in my Simulator 5.0. I got this below error.

"Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_CDVViewController", referenced from:
      _OBJC_CLASS_$_ViewController in ViewController.o
      objc-class-ref in AppDelegate.o
  "_OBJC_METACLASS_$_CDVViewController", referenced from:
      _OBJC_METACLASS_$_ViewController in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)" 

Please help me to solve this issue. Thanks in Advance. And i have attach the Screen Shot of error page for your reference. enter image description here

Answer

schmunk picture schmunk · Oct 4, 2012

Check if your project links libCordova.a (in my case Xcode forgot about the reference, when moving CordovaLib.xcodeproj to another location).

  • select your project in the Project Navigator
  • go to the Summary tab
  • drag CordovaLib.xcodeproj > Products > libCordova.a to Linked Frameworks and Libraries

enter image description here

Clean & build.