1

我使用 CMake 创建了一个框架并将其添加到测试项目中。然后导入头文件,一切正常。调用该方法时出现此错误。我不知道为什么会出现这个错误。我尝试了几乎所有可能的方法,但没有奏效。任何建议将不胜感激。

问题

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

我试过这些方法

  1. Other Linker Flags添加$(inherited)

  2. 删除DerivedData

  3. 设置NOActive Architecture Only

脂肪信息

Architectures in the fat file: xml are: x86_64 armv7 armv7s arm64

附上截图

项目结构

4

1 回答 1

1

您使用已在模拟器上编译的二进制文件进行编译,但尝试在真实设备上运行该应用程序。

最简单的方法是在设备上编译,然后在设备上运行。最难的方法是检查“lipo”可以做什么:)

于 2018-08-02T13:00:25.490 回答