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)

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

4 Comments

so what should I supposed to do now ?
@AshishPatil You need to add the file that implements MyDatabase to the binary target. See this SO answer for how to do that: stackoverflow.com/questions/5300785/…
m gettin following error now, what is this ? 0x12c3d35: movl 16(%edx), %edx Thread 1 : EXE_BAD_ACCESS
@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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.