使用添加的静态库构建项​​目时出错

时间:2012-08-23 12:16:22

标签: ios static-libraries

当我运行我的项目时,我有错误,这个项目包括静态库。

Undefined symbols for architecture i386:
"_OBJC_CLASS_$_Composer", referenced from:
  objc-class-ref in libImageCollage_Simulator.a(ImageCollageTableViewController.o)
"_OBJC_CLASS_$_FirstTableViewCell", referenced from:
  objc-class-ref in libImageCollage_Simulator.a(ImageCollageTableViewController.o)
"_OBJC_CLASS_$_SecondTableViewCell", referenced from:
  objc-class-ref in libImageCollage_Simulator.a(ImageCollageTableViewController.o)
"_OBJC_CLASS_$_ThirdTableViewCell", referenced from:
  objc-class-ref in libImageCollage_Simulator.a(ImageCollageTableViewController.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 :(得分:0)

您的项目已与静态库链接,您尚未在项目中添加libImageCollage_Simulator.a库,要在项目设置中添加“转到构建阶段”,请在“目标依赖项”中单击+并将库添加到您的项目中项目enter image description here

此处还添加了库搜索路径 转到构建阶段并双击库搜索路径,单击加号并在项目中添加库的路径