40

So today I ran into a major problem. I got a problem involving my viewcontroller on xcode 4.3.2 as seen in this error message:

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.

Ashan Marla
  • 1,371
  • 2
  • 10
  • 8

2 Answers2

94

Finally found the answer. In your target settings, locate build phases and navigate to compile sources. Once there just ad the .m file that is getting the error to the list.

Ashan Marla
  • 1,371
  • 2
  • 10
  • 8
0

For me the following method worked.

In target -> Build Phases -> Compile Sources I had all .m files including those that were giving issue.

Simply I removed those .m files which were giving issue.

chakri Reddy
  • 2,920
  • 1
  • 15
  • 12