Objective-C ++和C ++可以编译到iOS中的相同静态库中吗?

时间:2013-11-24 09:53:26

标签: c++ ios xcode static-libraries objective-c++

我正在为使用C ++和Objective-C ++代码的iOS 7软件构建一个静态库。

尝试在与C ++相同的库中放入Objective-C ++(。mm)会在链接时出现以下错误:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_XYZ", referenced from:
      objc-class-ref in ViewController.o
  "_OBJC_CLASS_$_Thisissomefunc", referenced from:
      objc-class-ref 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)

这是否可能,或者我应该将obj-c ++与c ++分开并使用两个静态库?

谢谢

0 个答案:

没有答案