iOS关于armv7,armv7s,arm64,i386,x86_64
2017-06-08 14:44
323 查看
iOS测试分为模拟器测试和真机测试,处理器分为32位处理器,和64位处理器,
模拟器32位处理器测试需要i386架构,(iphone5,iphone5s以下的模拟器)
模拟器64位处理器测试需要x86_64架构,(iphone6以上的模拟器)
真机32位处理器需要armv7,或者armv7s架构,(iphone4真机/armv7, ipnone5,iphone5s真机/armv7s)
真机64位处理器需要arm64架构。(iphone6,iphone6p以上的真机)
project -> target -> building setting -> Arhitectures 设置
debug属性设置为no的时候,会编译支持所有架构的版本,编译的速度会变慢,设置为yes 的时候,只编译当前的architecture版本,编译速度快。
一般情况下,debug 设置为yes,release为no,这样发行版本能适应不同设备,
Undefined symbols错误的解决方案整理
.h(声明文件)<————>.m(实现文件)
.h<————>.c
.hpp<————>.cpp
1》在源代码中,找不到一个标识符的声明,无论是变量名,类名,或者是方法名,编译的时候会得到
Use of undeclared identifier ‘XXX’错误。
2》在源代码中,如果编译器找到他的声明,却不知道他怎么实现的,或者说目标文件里没有这个实现,则就会出现链接错误。
Undefined symbols for architecture armv7(armv7处理器架构指令集下,符号未定义):
"_XCloseIM", referenced from:
dlib::gui_core_kernel_2_globals::event_handler_thread::~event_handler_thread() in gui_core_kernel_2.o
编译原理,在源码词法分析,语法分析以及编译的整个过程中,会生成符号表,所有标识符都会放到这个表中。 如果链接的时候,找不到具体的实现,就会出现这个错误。可能的原因有:
引入了需要用到的库的头文件,却没有链接正确的实现库。因为Xcode本身所支持的库是Static Library,即.a的方式,.a的文件里只有实现,使用的时候需要另外引入头文件,那么就有可能把头文件放进来,没有放.a或放入了错误的版本。
Build Settings或者Build Phases配置有误。检查Build Phases里的Link Binary With Libraries和Build Settings里的几项Search Path。
从外部导入的文件没有加入到特定的target中。这个正是我整理这篇日志之前遇到的,将.a、.m、.framework等引入到工程当中,却没有勾选当前Build的target,会出现这个问题,可以选中特定的文件,在右侧边栏中选中target。
未包含处理器架构指令集的问题。报错时的提示一般都是“Undefined symbols for architecture armv7”之类的,而“for architecture armv7”就是说没有支持armv7,在Build settings里architecture相关的几项需要配置正确。
当源码运行出现这种错,解决办法是target-->build setting-->compile sources as 把混编语言改回objective-c
就可以了
Undefined symbols for architecture armv7:
"_UIApplicationMain", referenced from:
_main in main.o
"_OBJC_CLASS_$_UIResponder", referenced from:
_OBJC_CLASS_$_AppDelegate in AppDelegate.o
"_OBJC_METACLASS_$_UIViewController", referenced from:
_OBJC_METACLASS_$_ViewController in ViewController.o
"_OBJC_CLASS_$_UINavigationController", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_UIWindow", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_UIScreen", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_METACLASS_$_UIResponder", referenced from:
_OBJC_METACLASS_$_AppDelegate in AppDelegate.o
"_OBJC_CLASS_$_UIViewController", referenced from:
_OBJC_CLASS_$_ViewController 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)
模拟器32位处理器测试需要i386架构,(iphone5,iphone5s以下的模拟器)
模拟器64位处理器测试需要x86_64架构,(iphone6以上的模拟器)
真机32位处理器需要armv7,或者armv7s架构,(iphone4真机/armv7, ipnone5,iphone5s真机/armv7s)
真机64位处理器需要arm64架构。(iphone6,iphone6p以上的真机)
project -> target -> building setting -> Arhitectures 设置
debug属性设置为no的时候,会编译支持所有架构的版本,编译的速度会变慢,设置为yes 的时候,只编译当前的architecture版本,编译速度快。
一般情况下,debug 设置为yes,release为no,这样发行版本能适应不同设备,
Undefined symbols错误的解决方案整理
.h(声明文件)<————>.m(实现文件)
.h<————>.c
.hpp<————>.cpp
1》在源代码中,找不到一个标识符的声明,无论是变量名,类名,或者是方法名,编译的时候会得到
Use of undeclared identifier ‘XXX’错误。
2》在源代码中,如果编译器找到他的声明,却不知道他怎么实现的,或者说目标文件里没有这个实现,则就会出现链接错误。
Undefined symbols for architecture armv7(armv7处理器架构指令集下,符号未定义):
"_XCloseIM", referenced from:
dlib::gui_core_kernel_2_globals::event_handler_thread::~event_handler_thread() in gui_core_kernel_2.o
编译原理,在源码词法分析,语法分析以及编译的整个过程中,会生成符号表,所有标识符都会放到这个表中。 如果链接的时候,找不到具体的实现,就会出现这个错误。可能的原因有:
引入了需要用到的库的头文件,却没有链接正确的实现库。因为Xcode本身所支持的库是Static Library,即.a的方式,.a的文件里只有实现,使用的时候需要另外引入头文件,那么就有可能把头文件放进来,没有放.a或放入了错误的版本。
Build Settings或者Build Phases配置有误。检查Build Phases里的Link Binary With Libraries和Build Settings里的几项Search Path。
从外部导入的文件没有加入到特定的target中。这个正是我整理这篇日志之前遇到的,将.a、.m、.framework等引入到工程当中,却没有勾选当前Build的target,会出现这个问题,可以选中特定的文件,在右侧边栏中选中target。
未包含处理器架构指令集的问题。报错时的提示一般都是“Undefined symbols for architecture armv7”之类的,而“for architecture armv7”就是说没有支持armv7,在Build settings里architecture相关的几项需要配置正确。
当源码运行出现这种错,解决办法是target-->build setting-->compile sources as 把混编语言改回objective-c
就可以了
Undefined symbols for architecture armv7:
"_UIApplicationMain", referenced from:
_main in main.o
"_OBJC_CLASS_$_UIResponder", referenced from:
_OBJC_CLASS_$_AppDelegate in AppDelegate.o
"_OBJC_METACLASS_$_UIViewController", referenced from:
_OBJC_METACLASS_$_ViewController in ViewController.o
"_OBJC_CLASS_$_UINavigationController", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_UIWindow", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_UIScreen", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_METACLASS_$_UIResponder", referenced from:
_OBJC_METACLASS_$_AppDelegate in AppDelegate.o
"_OBJC_CLASS_$_UIViewController", referenced from:
_OBJC_CLASS_$_ViewController 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)
相关文章推荐
- iOS关于armv7,armv7s,arm64,i386,x86_64等问题
- iOS关于armv7,armv7s,arm64,i386,x86_64等问题
- iOS开发~制作同时支持armv7,armv7s,arm64,i386,x86
- iOS 中的 armv7,armv7s,arm64,i386,x86_64 都是什么
- iOS 中的 armv7,armv7s,arm64,i386,x86_64 都是什么
- IOS生成同时支持armv7,armv7s,i386,x86_64,arm64的静态库.a文件
- iOS 中的 armv7,armv7s,arm64,i386,x86_64
- IOS生成同时支持armv7,armv7s,i386 x86_64的静态库.a文件
- iOS 中的 armv7,armv7s,arm64,i386,x86_64
- iOS开发~制作同时支持armv7,armv7s,arm64,i386,x86_64的静态库.a
- iOS开发~制作同时支持armv7,armv7s,arm64,i386,x86_64的静态库.a
- IOS:armv7,armv7s,arm64,i386,x86
- iOS 中的 armv7,armv7s,arm64,i386,x86_64 都是什么
- iOS开发~制作同时支持armv7,armv7s,arm64,i386,x86_64的静态库.a
- iOS开发~制作同时支持armv7,armv7s,arm64,i386,x86_64的静态库.a
- iOS开发~静态库.a中的armv7,armv7s,arm64,i386,x86_64含义
- iOS 中的 armv7,armv7s,arm64,i386,x86_64 都是什么
- 关于armv7,armv7s,arm64,i386,x86_64的理解
- iOS 中的 armv7,armv7s,arm64,i386,x86_64 都是什么
- IOS中armv7,armv7s,arm64以及i386和x86_64讲解