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 1013227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:04:08+00:00 2026-05-16T10:04:08+00:00

I am trying to cross-compile GCC on Mac OS 10.5.7. I used this command

  • 0

I am trying to cross-compile GCC on Mac OS 10.5.7. I used this command to configure GCC after installing GMP, MPFR, and MPC:

../gcc-4.5.0/configure --target=$i586-elf --prefix=/usr/local/cross \
    --disable-nls \
    --enable-languages=c,c++,fortran,java,objc,obj-c++,treelang,ada \
    --without-headers --with-libiconv-prefix=/opt/local --with-gmp=/usr/local \
    --with-mpfr=/usr/local --with-mpc=/usr/local

I got this error:

checking for the correct version of gmp.h... buggy but acceptable
checking for the correct version of mpfr.h... yes
checking for the correct version of mpc.h... yes
checking for the correct version of the gmp/mpfr/mpc libraries... no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations.  Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/.  See also
http://gcc.gnu.org/install/prerequisites.html for additional info.  If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files.  They may be located in separate packages.

Why could GCC find the headers for GMP, MPFR, and MPC but not the libraries?

  • 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-16T10:04:08+00:00Added an answer on May 16, 2026 at 10:04 am

    I suspect that the problem may be that the libraries are for 32-bit when you are attempting to build a 64-bit compiler, or vice versa.

    I was able to build GCC 4.5.1 on MacOS X 10.6.4 recently, but I built and installed the GMP, MPFR and MPC libraries myself – in /usr/gnu64 (a non-standard location that I use for stuff that I install for my own benefit). I also used the configuration option:

    CC='gcc -m64'
    

    to force a 64-bit build. I had similar problems on Linux (plus a problem with a regex in opt-functions.awk – easily fixed with two back-slashes in front of an open brace) and found that there were updates to the MPFR and MPC libraries since I built on MacOS X:

    • GMP 5.0.1 (instead of 4.2.4)
    • MPC 0.8.2 (instead of 0.8.1)
    • MPFR 3.0.0 (instead of 2.4.2)

    Since I wrote this, I’ve changed my methodology somewhat. What I now do is documented in Install GNU GCC on Mac. Basically, I get the current versions of GMP, MPC, MPFR and put their source code into the GCC source directory, and let GCC compile the libraries for itself. This makes GCC deal with locating the libraries.

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

Sidebar

Related Questions

I am trying to configure util-linux to cross compile using arm-none-linux-gnueabi from CodeSourcery. My
I'm trying to build a GCC cross-compiler with --host=x86_64-apple-darwin10 and --target=ppc64-linux . I need
I am trying to do a cross compile making use of gcc's -sysroot option.
I'm trying to cross-compile a 64-bit executable on a 32-bit ubuntu system. This works
I'm trying to cross compile bzip2 in Linux utilizing CMake's ExternalProject_Add(...) command. However, in
I'm trying to output the unicode latin cross character described in this chart :
I'm trying to cross-compile dropbear for android. The files appear to compile find, but
I'm trying get cross compiling between 2.7.7 and 2.8.0. The package is included, this
I'm trying to cross compile a helloworld kernel module with specifications: host: intel x86
I'm trying to cross compile an in house language(ihl) to Python. One of the

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.