i386架构下的未定义符号: "_CMTimeMake",被引用自:

6

我不明白为什么会发生这种情况。我正在尝试使用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个回答

29
您没有链接CoreMedia框架。 您可以通过项目编辑器将其添加到您的目标中,步骤如下:

链接框架


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接