Ashan Marla
Ashan Marla

Reputation: 33

"_OBJC_CLASS_$_", referenced from: error in xcode 4.3.2

So today I ran into a major problem. I got a problem involving my viewcontroller on xcode 4.3.2 as seen in the attached code:

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

I noticed that these errors only appear when I program IBActions linking my viewcontroller to additional classes. If I delete the IBActions the errors disappear. Any help is appreciated.

Thanks

Upvotes: 0

Views: 5861

Answers (2)

Saiful
Saiful

Reputation: 1909

Please add your SecondViewController.m or SecondViewController.mm, ThirdViewController.m/.mm, FourthViewController.m/.mm, Birdflix_ProViewController.m/.mm files to the Compile sources to build successfully.

To add files to compile source do the following

  1. Build phase in xcode
  2. Select Compile Sources
  3. Press + button to add .m/.mm file

Upvotes: 3

Rajesh Maurya
Rajesh Maurya

Reputation: 3164

I think that you have added some other static library. And you have not linked it in your project target. Fist clean all targets and build again then check project setting bar shows simulator version properly for active build target. Hope it will help.

Upvotes: 1

Related Questions