Error: "_ OBJC_METACLASS _ $ _ CDVViewController" referenced: "in Xcode4.3

I am new to iphone and phone development. Now I want to create a simple iphone application using phonegap. Now I am using phonegap2.0 in lion mac. MY Xcode version is 4.3. Now my problem is after installing phonegap2.0 in xcode, when I run 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 solve this problem. Thanks in advance. And I am attaching a page with screen screens for reference. enter image description here

+6
source share
4 answers

Check if your project libCordova.a (in my case, Xcode forgot about the link by moving CordovaLib.xcodeproj to another place).

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

enter image description here

Clean and build.

+13
source

Check the ViewController.m file and go to 1. Build phase in xcode 2. Select Compile Sources 3. Click the + button to add the .m / .mm file

I think it will work successfully now

+3
source

Extract armv7 from your build settings for your project and Cordoba subproject. Set the target to 4.3.

+2
source

I had a similar problem. Somehow, my NSManagedObject subclasses of my Core Data objects were in the Compilation Sources table twice. The compiler suffocates when it hits the first of these duplicates.

I just went into the compilation source table and deleted the second occurrence of each .m listing.

0
source

Source: https://habr.com/ru/post/926286/


All Articles