Search code examples
iosarmv7

Architecture armv7


I´m new into OS develop and i try to run an app but got an error

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

This is the line of the problem

self.timer = [[MMPDeepSleepPreventer alloc] init];

I trying to run this example

http://blog.marcopeluso.com/2009/08/23/how-to-prevent-iphone-from-deep-sleeping/


Solution

  • If this is not a unit test then you need to make sure that MMPDeepSleepPreventer.m is included in your targets compile sources.

    Xcode 4 Instructions:

    Project Navigator -> "[Project Name]" -> Under Targets select your target -> Build Phases -> Expand Compile Sources -> Click + at bottom of Compile sources and add the source file.

    If you continue to get similar errors then make sure all the source files are added and that you have added the necessary frameworks form the tutorial. The place to add frameworks also in the Build Phases of your target.

    If this is is a unit test see the answer below the accepted one here.