Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7641597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:57:51+00:00 2026-05-31T08:57:51+00:00

I need to use GMP in an iphone program I’m working on, but don’t

  • 0

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.

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

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.2" CXX="/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-g++-4.2" CPP="/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 -E" LD="$IOS/usr/bin/ld" CPPFLAGS="-arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -miphoneos-version-min=4.2" AR="$IOS/usr/bin/ar" NM="$IOS/usr/bin/nm" NMEDIT="$IOS/usr/bin/nmedit" LIBTOOL="$IOS/usr/bin/libtool" LIPO="$IOS/usr/bin/lipo" OTOOL="$IOS/usr/bin/otool" RANLIB="$IOS/usr/bin/ranlib" STRIP="$IOS/usr/bin/strip" --disable-shared --enable-static --prefix=$IOS/usr/local --host=none-apple-darwin10

Then make install.

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

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.

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)?

Thanks in advance.

Dan

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

  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.

  2. Find LIPO the three .a files together

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

  4. Done

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T08:57:53+00:00Added an answer on May 31, 2026 at 8:57 am

    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.

    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.

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a project that have the following need: use source ip address
I don't know if I'm wrong. But all I know is that in MVC,
Need to use own imaged markers instead built-in pins. I have several questions. 1.
I need to use an alias in the WHERE clause, but It keeps telling
I need to use lists for my program and needed to decide if I
Hello I need use Cyrillic chars inside of UrlRewriting.config Does any one know how
I have a view where I need use 2 models because I'm trying to
I have two tables (Master, Responses) I need use the Master_Id field from the
For a C project I'm writing I need to use the GMP library, which
I need use Insert Ignore for my table, which have Unique index on several

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.