Link the gmp library with Xcode 7.2

不打扰是莪最后的温柔 提交于 2019-12-13 07:25:34

问题


I try to link the gmp library with Xcode. This is what I (with the help of multiple stackoverflow articles) did:

  1. 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".
  2. In Xcode I added under "Other Linker Flags" (as described in multiple articles) -lgmp. I also tried -lgmpxx.
  3. 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!