Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dw153

macrumors newbie
Original poster
Dec 2, 2013
4
0
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
 
Consider adding the library path you installed your library to to the library search path, and the include directory to the include search path.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.