1

I am getting this error when I am compiling a program in Xcode.

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_MyDatabase", referenced from:
      objc-class-ref in Gallery_CollectionViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
bdash
  • 18,110
  • 1
  • 59
  • 91

1 Answers1

2

You have forgotten to add the source file that implements the class MyDatabase to the Xcode target and consequently it hasn't been compiled and linked with the binary.

trojanfoe
  • 120,358
  • 21
  • 212
  • 242
  • so what should I supposed to do now ? –  Feb 28 '13 at 09:38
  • @AshishPatil You need to add the file that implements `MyDatabase` to the binary target. See this SO answer for how to do that: http://stackoverflow.com/questions/5300785/adding-files-to-seperate-targets-in-xcode-4 – trojanfoe Feb 28 '13 at 09:40
  • m gettin following error now, what is this ? 0x12c3d35: movl 16(%edx), %edx Thread 1 : EXE_BAD_ACCESS –  Feb 28 '13 at 09:49
  • @AshishPatil That's a different issue. Ask a new question about that, and don't forget the symbolic stacktrace (i.e. type `bt` in the debugger console and post the output) and include the code around the lines that crashed. – trojanfoe Feb 28 '13 at 09:50