问题
I try to link the gmp library with Xcode. This is what I (with the help of multiple stackoverflow articles) did:
- I downloaded the gmp file and installed it (in the default location: /usr/local ) using "sudo make install" and I checked it with "make check".
- In Xcode I added under "Other Linker Flags" (as described in multiple articles)
-lgmp
. I also tried-lgmpxx
. - In main I included
<stdio.h>
and<gmp.h>
.
After all I still got the error: " 'gmp.h' file not found ", which indicates that the library is not properly linked. I don't see what I am doing wrong. Suggestions would be appreciated. Thanks in advance!
回答1:
To get C++ support, you need to run
./configure --enable-cxx
plus any other desired/required options, see https://gmplib.org/manual/Build-Options.html, before running
make install
来源:https://stackoverflow.com/questions/35101873/link-the-gmp-library-with-xcode-7-2