架构i386的未定义符号:“_ CMTimeMake”,引自:

时间:2014-09-26 20:18:47

标签: ios objective-c cmtime

我不明白为什么会这样。我正在尝试CMTimeMake:

CMTime cmTime = CMTimeMake(60, 1);

.h的导入是:

#import <UIKit/UIKit.h>
#import <MediaPlayer/MediaPlayer.h>
#import <AVFoundation/AVFoundation.h>

.m是:

#import "ViewController.h"
#import "ContentView.h"
#import "AppDelegate.h"
#import "BackButton.h"
#import "NavButton.h"
#import "IIViewDeckController.h"
#import "TutorialView.h"

构建错误为:

Undefined symbols for architecture i386:
  "_CMTimeMake", referenced from:
      -[ViewController activateLockScreenPlayer:] in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我错过了什么?

1 个答案:

答案 0 :(得分:26)

您没有与CoreMedia框架建立链接。您可以在项目编辑器中将其添加到目标中,如下所示:

linking the framework