1

可能重复:
由 CACurrentMediaTime() 引起的体系结构 i386 编译错误的未定义符号

我试图使用这个函数:CACurrentMediaTime(),因为我需要当前时间但我得到了这个错误

Ld /Users/aruffolo/Library/Developer/Xcode/DerivedData/Star-hbmohpuyghsjeseyswvvpevxkesj/Build/Products/Debug/Star.app/Contents/MacOS/Star normal x86_64
cd "/Users/aruffolo/Documents/Programmazione/Learning Objective-c/Star"
setenv MACOSX_DEPLOYMENT_TARGET 10.8
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/aruffolo/Library/Developer/Xcode/DerivedData/Star-hbmohpuyghsjeseyswvvpevxkesj/Build/Products/Debug -F/Users/aruffolo/Library/Developer/Xcode/DerivedData/Star-hbmohpuyghsjeseyswvvpevxkesj/Build/Products/Debug -filelist /Users/aruffolo/Library/Developer/Xcode/DerivedData/Star-hbmohpuyghsjeseyswvvpevxkesj/Build/Intermediates/Star.build/Debug/Star.build/Objects-normal/x86_64/Star.LinkFileList -mmacosx-version-min=10.8 -fobjc-arc -fobjc-link-runtime -framework SystemConfiguration -framework CoreMedia -framework Cocoa -o /Users/aruffolo/Library/Developer/Xcode/DerivedData/Star-hbmohpuyghsjeseyswvvpevxkesj/Build/Products/Debug/Star.app/Contents/MacOS/Star

Undefined symbols for architecture x86_64:
  "_CACurrentMediaTime", referenced from:
  -[MyView runLoop] in MyView.o
ld: symbol(s) not found for architecture x86_64
4

1 回答 1

11

将 QuartzCore 框架添加到您的项目中。

于 2013-01-03T16:28:18.530 回答