10

After adding Appirater to my iOS project, when I compile, I get the error:

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

After searching and searching on the internet, none of the solutions found helped.

Both my project and target are setup as:

enter image description here

What should I try more?

CristiC
  • 22,068
  • 12
  • 57
  • 89

4 Answers4

44

I think, that you only added files to project, but not to target.
Click on Appirater.m file in Project Navigator and set checkbox near to your target name in Target membership of File Inspector.

Tomasz Wojtkowiak
  • 4,910
  • 1
  • 28
  • 35
  • That was the problem. Thanks Tomasz. – CristiC Jan 21 '12 at 15:22
  • 4
    Just in case anyone doesn't know what/where file inspector is, in xcode 4 and 3 (if I remember correctly) You can go to view -> Utilities -> Show File Inspector. It should scroll in from the right. – Ben Coffman Jul 26 '12 at 13:28
  • You can also right/command click on the file in the Project Inspector and select "Show File Inspector", fourth option down, right above "New File". – Oblivious Sage Oct 30 '12 at 14:50
  • 1
    [See this answer](http://stackoverflow.com/a/14148008/77567) for an animated GIF demonstrating this. – rob mayoff Jan 03 '13 at 23:50
  • I have added the Appirator.m file to the target, but im still getting the exact same error - not sure why and still trying to find a solution. – Salman Mar 04 '13 at 02:06
  • @Nick your comment is so helpful, full of knowledge, almost the voice of reason. – Tomasz Wojtkowiak Sep 10 '13 at 10:59
  • and what should i do if i dont have the "Target membership" area in the "File Inspector" for the files inside the folder, i have that area just for the folder, but its checked and same error (XCode 7.2) – Martin Mlostek Jan 19 '16 at 10:43
3

It seems that you haven't properly added the Appirater code to your project. Both Appirater.h and Appirater.m must be part of your project, and Appirater.m must be compiled like all your other files.

Codo
  • 75,595
  • 17
  • 168
  • 206
2

You'll also get this error if you've neglected to add the CFNetwork and SystemConfiguration frameworks to your project.

Greg
  • 529
  • 5
  • 9
  • 1
    Help me. It was `StoreKit`, the other required framework, causing the problem for me. – Craig Nov 06 '14 at 17:55
1

I just had the same problem, and fixed it.

The cause of my issue is I had dragged and dropped a file from other project to the current.

Of course it is working when we remove and recreate the file.

LittleBobbyTables - Au Revoir
  • 32,008
  • 25
  • 109
  • 114
Patrick
  • 11
  • 1