编译x86_64老是不过,iphone模拟器debug不了解决方法
2016-10-16 17:36
381 查看
其实没什么好解决的,忍了2年了所以今天重新把所有代码,所有编译过程,重新看一遍编译curl很多遍了,老是提示architecture x86_64一开始以为是编译问题,还想用gcc重新编译但是明显curl是一个第三方库,而它也是可能引用第第三方库从上面截图可以看出
"_zlibVersion",referenced from: _curl_version in lib curl.a _curl_version_info in lib curl.a _Curl_unencode_gzip_write in lib curl.a明显的是用到zlib库(zip库)所以看来还是得从zlib着手(zlib的x86_64框架已编译通过)------------2016.10.15编译了几天,发现openssl又出问题了,网上下的所谓x86_64还是不行所以还是自己编译吧,arm7和x86_64的openssl编译方法见下链接点击打开链接macos编译提示 option -BsymbolicBsymbolic完全不知道什么鬼,百度之,原因是:The
-Bsymbolicflagspecified in the
Makefileofthat project is specific to the GNU linker and platforms using the ELF binary format. OS X uses neither. The
Makefilehasseveral other flags that aren't compatible with the OS X toolchain, such as the use of the
.soextensionfor shared libraries rather than
.dylib,and another unsupported linker flag (
-Wl,-soname=…).You should be able to remove the unsupported linker flags and then fix up the file extensions to make things work.-Wl,-Bsymbolic.其中 Wl 表示将紧跟其后的参数,传递给连接器 ld 。 Bsymbolic 表示强制采用本地的全局变量定义,这样就不会出现动态链接库的全局变量定义被应用程序/动态链接库中的同名定义给覆盖了!查到了病没有什么卵用,因为根本不知道怎么解决解决方法应该在这里http://stackoverflow.com/questions/7216973/is-there-a-downside-to-using-bsymbolic-functions------------2016.10.19又一个不错的openssl自下载,自编译库,可以参考一下,但请不要报侥幸心理,最好还是自己把编译过程搞懂(2000行左右的makefile代码),要不花的时间更多 http://www.andyibanez.com/quick-tip-compile-openssl-arm-arm64-ios/ 编译提示xxx.shared出错,实在找不到-Bsymbolic在哪里后来终于在makefile.shared找到了这么一段,remark之#SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"DO_GNU_SO_COMMON=\SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"编译提示xxx.shared出错,虽然找到了-soname在哪里但实在奇怪的是mac iphone的动态库是dylib 而不是so“This is strange, as Mac has .dylib extension instead of .so.”其实歪果仁真的是大惊小怪,以我的理解,so是静态库,静态库解决方法:I had a similar issue on OS X which I resolved using the the
install_nameswitchinstead of
soname.
gcc -shared <files> -lc -Wl,-install_name,<libname>.so, -o <libname>.so.1xxx.shared出错,现在是--whole-archive首先 --whole-archive 和 --no-whole-archive 是ld专有的命令行参数,gcc 并不认识,要通gcc传递到 ld,需要在他们前面加 -Wl,字串。--whole-archive 可以把 在其后面出现的静态库包含的函数和变量输出到动态库,--no-whole-archive 则关掉这个特性。比如你要把 liba.a libb.a libc.a 输出到 libabc.dll(或libabc.so)时应该这么写:libabc.dll:liba.c libb.a libc.a gcc -shared -o $@ -L. -Wl,--whole-archive -la -lb -lc -Wl,--no-whole-archive在--whole-archive作用下的库里不能有函数同名。xxx.shared出错,这下好了,直接就说缺了x86_64这个问题解决方法反而简单,有连续看我博客的都知道,要是你真的觉得自己是程序猿不要抱有侥幸心理,还是从源头搞起,这个问题这里出现了,总比在你自以为编译成功了,然后放到真机调试,出现摸不着头脑的问题,又或者你自以为成功,乐于开源,上传到网上说这是x86_64的版本,而坑到别人,其实这个库的第三方库根本就有问题(我被坑不少,不知道你们程序猿如何)
相关文章推荐
- x86_64上编译32bit汇编指令报错,解决方法
- mac下编译安装php7时报ld: symbol(s) not found for architecture x86_64的解决方法
- protobuf 编译iOS,lib curl缺少行 x86_64的解决方法
- react native项目介入萤石云SDK,DEBUG模式或者模拟器编译错误的解决方法
- SDK Manager不能下载x86 ICS 模拟器问题解决方法
- [ios] CFFTPSample 代码无法在iPhone上编译解决方法【转】
- IPHONE IOS6 模拟器没有HOME按键解决方法
- 64 位 win7(2008 r2) 使用PLSQL Developer x86 32bit的解决方法
- iPhone ZBar库 中文乱码解决方法--重新编译libzbar.a
- [原]Redhat-el5_x86_64下Xen安装、配置、使用及出现的问题和解决方法
- Linux内核2.6.34.14添加系统调用及编译方法(CentOS-6.4-x86_64)
- ATL编译时只能用debug编译的解决方法
- GDI+在VS2008 编译不过的解决方法
- ATL编译时只能用debug编译的解决方法
- ATL编译时只能用debug编译的解决方法
- VC6编译的Debug版本程序中存在的问题及解决方法
- iPhone ZBar库 中文乱码解决方法--重新编译libzbar.a 请勿转载
- ATL编译时只能用debug编译的解决方法
- GDI+在VS2008 编译不过的解决方法