8

Am using Xcode 4.5.

Recently i have download GHunit framework and setup it by following link.

On compiling the target, am getting the error mentioned below. need your valuable suggestion.

Undefined symbols for architecture i386:
      "_CACurrentMediaTime", referenced from:
          _GHRunForInterval in GHUnitIOS(GHTestUtils.o)
          _GHRunUntilTimeoutWhileBlock in GHUnitIOS(GHTestUtils.o)
    ld: symbol(s) not found for architecture i386
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
Abdul Rahman
  • 2,097
  • 4
  • 28
  • 36
yokks
  • 5,683
  • 9
  • 41
  • 48

2 Answers2

24

CACurrentMediaTime is declared at CABase.h and implemented at QuartzCore framework, you'll need to link it to the project.

A-Live
  • 8,904
  • 2
  • 39
  • 74
  • 1
    @yokks Please uncheck the answer if it doesn't solve the problem, if you found another solution you are always welcome to answer yourself and accept it instead. – A-Live Nov 15 '12 at 14:00
  • 1
    And for the persone down-voted the answer, here's the GHUnit source file from the (currently) latest version tag, there you can see import of the QuartzCore header: https://github.com/gabriel/gh-unit/blob/0.5.6/Classes-iOS/GHUnitIOSTestView.m – A-Live Nov 15 '12 at 14:10
  • 2
    You are correct. The error is due to QuartzCore framework not linked. Let me up vote for you. – samwize Nov 21 '12 at 14:53
  • @yokks could you try updating GHunit to the latest version and check if this solution works for you ? It seems to be helpful for other users, let's try to find out what is different for you. – A-Live Feb 01 '13 at 09:08
1

In our mobile application development course at school, we have been using this tutorial http://www.raywenderlich.com/3716/unit-testing-tutorial-for-ios-xcode-4-quick-start-guide

And It does not Run without the QuartzCore.framework as well, so thank you very much !

Renegade_Mtl
  • 430
  • 3
  • 8