Undefined symbols for architecture i386 "_OBJC_CLASS_$_Appirater"

19,618

Solution 1

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.

Solution 2

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.

Solution 3

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

Solution 4

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.

Share:
19,618
CristiC
Author by

CristiC

Self-teaching is the most powerfull instrument of all.

Updated on June 08, 2022

Comments

  • CristiC
    CristiC almost 2 years

    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
    CristiC over 12 years
    That was the problem. Thanks Tomasz.
  • CristiC
    CristiC over 12 years
    The Appirater.m file was not added to the target. This was the problem.
  • Ben Coffman
    Ben Coffman almost 12 years
    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.
  • Oblivious Sage
    Oblivious Sage over 11 years
    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".
  • rob mayoff
    rob mayoff over 11 years
    See this answer for an animated GIF demonstrating this.
  • Salman
    Salman about 11 years
    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.
  • Tomasz Wojtkowiak
    Tomasz Wojtkowiak over 10 years
    @Nick your comment is so helpful, full of knowledge, almost the voice of reason.
  • Craig
    Craig over 9 years
    Help me. It was StoreKit, the other required framework, causing the problem for me.
  • Martin Mlostek
    Martin Mlostek over 8 years
    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)