Getting started with GMP and Xcode

Discussion in 'Mac Programming' started by dw153, Dec 2, 2013.

  1. dw153 macrumors newbie

    Joined:
    Dec 2, 2013
    #1
    So I'm pretty new to coding and such like. I'm currently taking a C++ module in university which has a particular bent towards mathematical programming. We are required to use the GMP library, and it just works on the campus PCs, but I'd like to be able to use it at home on my Mac(s) with Xcode. I'd appreciate some help in getting it to work, preferably in simple steps!

    So far I've downloaded the .tar.bz2 from gmplib.org, and unzipped (untarred?) it. I've followed the instructions here to install it, although I remain unconvinced that it's actually worked 100%.

    In an Xcode project (I'm using the latest version on OS 10.9 btw) I've out the Other Linker Flags to -lgmpxx -lgmp (which is very similar to what we had to do to set up GMP for our user on campus). In main.cpp I can do
    Code:
    #include <gmpxx.h>
    and it recognises things like
    Code:
    mpz_class
    etc. but it won't compile and run.

    Any help greatly appreciated. But bear in mind I'm not a whizz with Xcode or a command line!

    David
     
  2. cbreak macrumors member

    cbreak

    Joined:
    Mar 22, 2008
    #2
    Consider adding the library path you installed your library to to the library search path, and the include directory to the include search path.
     

Share This Page