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

4

6

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

Spenser answered 26/9, 2012 at 7:25 Comment(0)
M
13

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.

Myna answered 4/10, 2012 at 16:46 Comment(0)
B
3

Please check your ViewController.m file and goto to 1. Build phase in xcode 2. Select Compile Sources 3. Press + button to add .m/.mm file

I think it will run successfully now

Beatrix answered 27/9, 2012 at 7:58 Comment(3)
"Undefined symbols for architecture armv6: "_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 armv6 clang: error: linker command failed with exit code 1 (use -v to see invocation)"Spenser
Soory. Now i got the Above same error. Then what is that .m/.mm file. Sorry. I can't get that message. Sorry.Spenser
.m/.mm file means ViewController.m /ViewController.mm file or any other viewController .m or .mm file(Source code).Please add all .m or .mm file to Build Phase->Compile Sources.Then clean your project and build again.Beatrix
A
2

Remove armv7s from your build settings, for both your project and the referenced subproject Cordova. Set your target to 4.3.

Acriflavine answered 2/10, 2012 at 23:59 Comment(0)
W
0

I had a similar issue. Somehow my the NSManagedObject Sub-classes of my Core Data entities were in the Compile Sources table twice. The compiler would choke when it hit the first of these duplicates.

I just went into the Compile Sources table and deleted the second occurrence of each .m listing.

Wendellwendi answered 5/12, 2013 at 19:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.