C语言 在哪里可以找到“gmp.h”?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7351205/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where to find "gmp.h"?
提问by SoftTimur
I am installing a library, and got this error message:
我正在安装一个库,并收到此错误消息:
xxxx@ubuntu$ make
(cd num; make all)
make[1]: Entering directory `/home/xxxx/num'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/xxxx/num'
(cd itv; make all)
make[1]: Entering directory `/home/xxxx/itv'
gcc -Wcast-qual -Wswitch -Werror-implicit-function-declaration -Wall -Wextra -Wundef -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wno-unused -std=c99 -U__STRICT_ANSI__ -O3 -DNDEBUG -I../num -I../apron -I/usr/include -I/usr/include -DNUM_MPQ -c -o itvMPQ.o itv.c
In file included from itv.h:9:0,
from itv.c:5:
../num/num.h:15:17: fatal error: gmp.h: No such file or directory
compilation terminated.
make[1]: *** [itvMPQ.o] Error 1
make[1]: Leaving directory `/home/xxxx/itv'
make: *** [c] Error 2
So the problem is that it can not find gmp.h, does anyone know where this file is located, and how to make it found by the installer? By the way, at the moment my Makefilepoints mainly to /usrand /usr/local...
所以问题是它找不到gmp.h,有谁知道这个文件在哪里,以及如何让安装程序找到它?顺便说一句,目前我的Makefile观点主要是/usr和/usr/local......
Edit1: After installing libgmp3-devas suggested, the current error message is ../num/num.h:16:18: fatal error: mpfr.h: No such file or directory, does anyone know which package it is about?
Edit1:libgmp3-dev按照建议安装后,当前的错误信息是../num/num.h:16:18: fatal error: mpfr.h: No such file or directory,有谁知道它是关于哪个包的?
Edit2: I have installed MPFRby following this page, and that did help, now the error message is gmp_caml.c:17:33: fatal error: caml/camlidlruntime.h: No such file or directory, could anyone help?
Edit2:我已经MPFR按照这个页面安装了,这确实有帮助,现在错误信息是gmp_caml.c:17:33: fatal error: caml/camlidlruntime.h: No such file or directory,有人可以帮忙吗?
Edit3: I have done apt-file search camlidlruntime, and it returns camlidl: /usr/lib/ocaml/caml/camlidlruntime.h, but there is no camlidlruntime.hin my folder /usr/lib/ocaml/caml/, how could I check if I have installed dev package of MPFR? and which package it is exactly about?
Edit3:我已经完成apt-file search camlidlruntime,它返回camlidl: /usr/lib/ocaml/caml/camlidlruntime.h,但camlidlruntime.h我的文件夹中没有,我/usr/lib/ocaml/caml/如何检查我是否已安装dev package of MPFR?它到底是关于哪个包?
回答by Vivek Goel
you need to install libgmp3-dev
你需要安装 libgmp3-dev
depends on your linux
取决于你的 Linux
yum install libgmp3-dev
apt-get install libgmp3-dev
回答by mpontillo
On OS X (if you're using Homebrew), do this:
在 OS X 上(如果您使用的是 Homebrew),请执行以下操作:
brew install gmp
回答by Nishant
In Centos 6.5 it is sudo yum install gmp gmp-devel gmp-status.
在 Centos 6.5 中,它是sudo yum install gmp gmp-devel gmp-status.
ProTip: Just search for the gmp in yum and also check out yum provides command.
专业提示:只需在 yum 中搜索 gmp 并查看 yum 提供的命令。
回答by Valentin Montmirail
Because it can happen that you need this library in 32 bit format for any particular reason (like it was for me)
因为您可能出于任何特定原因需要 32 位格式的库(就像我一样)
You will need to run (on an Ubuntu/Debian) :
您需要运行(在 Ubuntu/Debian 上):
apt-get install libgmp3-dev:i386
the suffix :i386behind any library will install the 32 bits version of it.
:i386任何库后面的后缀都会安装它的 32 位版本。
回答by Joachim
I did a lot of research and finally I could compile hue with the following environment variables:
我做了很多研究,最后我可以用以下环境变量编译 Hue:
export CPFLAGS="-I/usr/local/include/gmp.h -I/usr/local/opt/openssl/include"
export CFLAGS="-I/usr/local/include/gmp.h"
export CXXFLAGS="-I/usr/local/include/gmp.h"
export LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl/lib"
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
回答by Prabhat Soni
For me this worked:-
对我来说这有效:-
apt-get install libgmp3-dev (Might vary in linux distro; this is for Ubuntu)
pip3 install gmpy --user

