i'm trying to get GMP working with Xcode. So far I have untared the file in the home directory, ran all the necessary commands to have it configure, make, and install
./configure --prefix=/usr/local --enable-cxx
make
make check
sudo make install
Both the gmp.h and gmpxx.h are in the usr/local/include, however I still am getting an error when trying to include the files. I believe I need to add a complier flag but for this version of Xcode I do not know how to do that. If that is not the case and I need to do something else please advise and I would very much appreciate it.
My code looks like the following:
#include <iostream>
#include <gmp.h>
int main(int argc, const char * argv[]) {
// insert code here...
std::cout << "Hello, World!\n";
return 0;
}
Can I code with GMP in c++ ? Or do I need code in c? Any help getting this to work would be very much appreciated, thanks a ton in advance!
Sorry if this seems like a DUPLICATE question, i did look at the other questions and I was not able to get it to work following answers from previous questions.
UPDATE
Added the libgmp.la and libgmpxx.la to Xcode, also added /usr/local/include to header file search and it is still not working! I see the library files in my project and if I put "gmp.h" instead of it works but when I go to use GMP it fails telling me to chnange the in other GMP files to "gmp.h" which doesn't seem right.
ANY IDEAS?