简体   繁体   English

Linux下使用ndk的Android中的ObjC代码

[英]ObjC code in Android using ndk under Linux

I am trying to implement this under Linux, Adding Objective C Support to the Android NDK 我试图在Linux下实现此目标向Android NDK添加目标C支持

I took some references from here 我从这里参考了一些

http://blog.vucica.net/2011/06/developing-objective-c-apps-for-android-using-mac-os-x.html http://blog.vucica.net/2011/06/developing-objective-c-apps-for-android-using-mac-os-x.html

but it doesn't compile, since the binaries are for OS-X 但由于二进制文件是针对OS-X的,因此无法编译

So after that I decided to compile the ndk-tools for Linux, following this link 因此,在此之后,我决定按照此链接为Linux编译ndk-tools

http://michael.f1337.us/2011/11/19/rebuilding-the-android-ndk-for-objective-c-support/ http://michael.f1337.us/2011/11/19/rebuilding-the-android-ndk-for-objective-c-support/

first error I got , was missing --mpc-version info, which could be added manually in the build-gcc.sh file, Now I am stuck at the next step, where I am getting this error 我遇到的第一个错误是缺少--mpc-version信息,可以将其手动添加到build-gcc.sh文件中,现在我陷入了下一步,在此错误中

Error: 错误:

“Fixing Google Bug Copying from /home/SDKs/Android/toolchain-src/binutils/binutils-2.22.51/binutils/sysinfo.h to /tmp/ndk-root/build/toolchain/binutils-2.22.51/binutils/sysinfo.h” “将Google Bug复制从/home/SDKs/Android/toolchain-src/binutils/binutils-2.22.51/binutils/sysinfo.h修复到/tmp/ndk-root/build/toolchain/binutils-2.22.51/binutils/ sysinfo.h”

Building : arm-linux-androideabi-4.6.1 toolchain [this can take a long time]. 构建:arm-linux-androideabi-4.6.1工具链[这可能需要很长时间]。 Error while building toolchain. 构建工具链时出错。 See /tmp/ndk-root/build/toolchain/config.log 参见/tmp/ndk-root/build/toolchain/config.log

which further says : 进一步说

configure: error: in `/tmp/ndk-root/build/toolchain/libbfd-binutils-2.22.51': 配置:错误:在`/tmp/ndk-root/build/toolchain/libbfd-binutils-2.22.51'中:

configure: error: C compiler cannot create executables 配置:错误:C编译器无法创建可执行文件

If anyone ever came across this or has any information regarding this, please share.. thanks a lot !! 如果有人遇到过此事或有任何有关此事的信息,请分享..非常感谢!

I rebuild latest NDK for supporting ObjC, just from vanilla. 我从原始版本重建了最新的NDK以支持ObjC。 So, you need just perform 2 scripts and change 2 files in NDK. 因此,您只需要执行2个脚本并在NDK中更改2个文件即可。

for download toolchain ./download-toolchain-sources.sh 用于下载工具链./download-toolchain-sources.sh

and rebuild gcc, but don't forget to modify it. 并重建gcc,但不要忘记对其进行修改。 ./build-gcc.s ./build-gcc.s

What the files you need to modify, you can find on page http://michael.f1337.us/2011/11/19/rebuilding-the-android-ndk-for-objective-c-support/ 您需要修改哪些文件,可以在以下页面找到: http://michael.f1337.us/2011/11/19/rebuilding-the-android-ndk-for-objective-c-support/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM