为iOS构建GMP [英] Build GMP for iOS

查看:233
本文介绍了为iOS构建GMP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我正在使用的iphone程序中使用 GMP ,但不知道从哪里开始。我知道我必须为设备构建一个版本,并为模拟器构建一个版本,但这就像我所知道的那样。我试过环顾四周但却找不到多少。

I need to use GMP in an iphone program I'm working on, but don't really know where to begin. I know that I have to build a version for the device and a version for the simulator, but that is as much as I know. I've tried looking around but haven't been able to find much.

这里有没有人成功建立 GMP 对于 iphone ,这将指导我完成整个过程?

Has anyone here successfully build GMP for iphone that would care to guide me through the process?

我看到为iOS构建GMP 但它不适合我。
我以为我使用以下方法成功构建了它:

I saw Building GMP for iOS but it is not working for me. I thought I had built it successfully using:

./ configure CC =/ Developer / Platforms / iPhoneOS.platform / Developer /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2CXX =/ Developer / Platforms / iPhoneOS.platform / Developer / usr / llvm-gcc-4.2 / bin / llvm -g ++ - 4.2CPP = /Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 -ELD =$ IOS / usr / bin / ldCPPFLAGS = - arch armv7 -isysroot /开发人员/平台/ iPhoneOS.platform / Developer / SDKs / iPhoneOS5.0.sdk -miphoneos-version-min = 4.2AR =$ IOS / usr / bin / arNM =$ IOS / usr / bin / nm NMEDIT =$ IOS / usr / bin / nmeditLIBTOOL =$ IOS / usr / bin / libtoolLIPO =$ IOS / usr / bin / lipoOTOOL =$ IOS / usr / bin / otoolRANLIB = $ IOS / usr / bin / ranlibSTRIP =$ IOS / usr / bin / strip--disable-shared --enable-static --prefix = $ IOS / usr / local --host = none-apple- darwin10

然后进行安装。

/ usr / local / lib 我有 libgmp.a 。但是当我去编译它时,我拖到 xcode 它告诉我:

In /usr/local/lib I have libgmp.a. But when I drag to to xcode when I go to compile it tells me:

忽略文件/Users/daniel/Desktop/libgmp.a,文件是为存档而构建的,而不是被链接的架构(armv7)(我出于某种原因放入桌面,然后拖到我的桌面xcode项目)

ignoring file /Users/daniel/Desktop/libgmp.a, file was built for archive which is not the architecture being linked (armv7) (I dropped in my desktop for some reason, then dragged to into my xcode project)

这让我疯了。有人可以帮忙吗?请记住,使用这些工具,我是一个完整的菜鸟。

This is driving me nuts. Can anyone help? Bear in mind I'm a complete noob using the these tools.

假设我得到了帮助,我可以做到这一点。如何将其转换为适用于 armv6 armv7 和<$ c $的框架c>模拟器(i386)?

Assuming I get help and I can make this work. How do I go about turning it into a framework that will work on an armv6, armv7, and simulator(i386)?

提前致谢。

Dan

更新:如果其他人有问题,我是如何解决它的。

UPDATE: Should anyone else have the problem here is how I solved it.


  1. 首先交叉编译GMP 3次,将架构设置为armv6。 armv7和i386分别。构建arm版本时,将标志-DNO_ASM添加到CPPFLAGS。

  1. First cross compile GMP 3 times, setting the architectures to armv6. armv7, and i386 respectively. When building the arm versions add the flag -DNO_ASM to CPPFLAGS.

一起查找三个.a文件的LIPO

Find LIPO the three .a files together

使用gmp.g和gmpgxx.h将.a文件导入XCode。

Import .a file to XCode with gmp.g and gmpgxx.h.

完成


推荐答案

根据rob的建议,我会回答我的问题并接受答案。我是新手,所以如果有更简单的方式原谅我,这就是我管理的方式。

As suggested by rob, I will answer my question and accept the answer. I'm new to this, so if there is an easier way forgive me, this is how I managed do it.

要为iPhone构建GMP,你必须建立三个库从命令行三次。构建armv6,armv7和i386架构。为确保xcode没有问题,请确保将-DNO_ASM添加到CPPFLAGS。一旦你有三个.a文件,将它们组合成一个库。

To build GMP for iphone you must build three the library from the command line three times. Build for the armv6, armv7, and i386 architectures. To ensure no problems in xcode make sure you add -DNO_ASM to CPPFLAGS. Once you have the three .a files, lipo them together into one library.

您现在可以将使用lipo创建的库添加到xcode中并包含标题,您现在可以使用GMP进行iphone开发。

You can now add the library you created with lipo into xcode and include the headers, you now have GMP working for iphone development.

我希望这会有所帮助。我花了几天时间试图解决这个问题。

I hope this helps. I spent a couple days trying to figure this out.

这篇关于为iOS构建GMP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆