ios - 从静态库初始化对象时,在构建过程中发生编译错误

标签 ios compiler-errors static-libraries objectinstantiation

尝试在数据解析器类中创建和初始化对象时出现以下编译错误。该代码是

Component *component=[[Component alloc] initWithInputComObjects:inputComObjects withOutputComObjects:outputComObjects];

其中initWithInputComObjects:inputComObjects:withOutputComObjects:outputComObjects是库中.m文件内部的方法

ld: warning: directory not found for option '-L/Users/admin/Desktop/KNXComfort/Pods/build/Debug-iphoneos' ld: warning: ignoring file /Users/admin/Desktop/KNXComfort/KNXComfort/libKNXCommuncationLib.a, missing required architecture i386 in file /Users/admin/Desktop/KNXComfort/KNXComfort/libKNXCommuncationLib.a (3 slices) Undefined symbols for architecture i386: "_OBJC_CLASS_$_Channel", referenced from: objc-class-ref in DataParser.o "_OBJC_CLASS_$_ComObject", referenced from: objc-class-ref in DataParser.o "_OBJC_CLASS_$_Component", referenced from: objc-class-ref in DataParser.o "_OBJC_CLASS_$_Device", referenced from: objc-class-ref in DataParser.o (maybe you meant: _OBJC_CLASS_$_DevicesCollectionViewController, _OBJC_CLASS_$_DevicesCollectionViewCell ) ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

最佳答案

Undefined symbols for architecture i386



您正在尝试为i386处理器进行构建,但是您尝试使用的库并未为支持该体系结构而构建。

您或者需要从构建中删除i386(为设备构建),或者重建该库以包括对i386的支持。

关于ios - 从静态库初始化对象时,在构建过程中发生编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24649484/

相关文章:

ios - 显示位置权限对话框并立即消失

ios - 静音 Cordova 插件 cordova-plugin-camera-preview

ios - 在 iOS 中添加指向 nsattributedstrings 的链接时出现越界错误

c++ - 如何使用 Armadillo 计算特征对?

c++ - 使用 --whole-archive 标志链接

ios - UITableViewController 和 TableView 高度

android - 无法为 org.gradle.api.Project 类型的根项目 'compileSdkVersion' 获取未知属性 'Cropimg'。

c++ - C/C++ 重复符号错误

opencv - 安装 OpenCV 3.0.0-dev,配置选项问题