Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/usr/bin/ld: cannot find -lgmp

Tags:

centos

[root@ bncsutil]# make
g++  -Wall -O3 -I ../ -Wno-multichar -fPIC -shared -lgmp bsha1.o cdkeydecoder.o checkrevision.o decodekey.o file.o libinfo.o oldauth.o nls.o pe.o sha1.o stack.o -o libbncsutil.so
/usr/bin/ld: cannot find -lgmp
collect2: ld returned 1 exit status
make: *** [libbncsutil.so] Error 1

I try to do this in centos-6-x86-devel. Gmp is already installed. Seems like something wrong with path, but i don't know what exactly do.

like image 377
mzarb Avatar asked Feb 06 '14 13:02

mzarb


People also ask

How do you resolve usr bin Ld Cannot find?

To resolve this problem, you should either provide the library file ( lib{nameOfTheLibrary}. so ) in those search paths or use -L command option. -L{path} tells the g++ (actually ld ) to find library files in path {path} in addition to default paths.

What is Ldflags in Makefile?

LDFLAGS: Extra flags to give to compilers when they are supposed to invoke the linker, 'ld', such as -L. Libraries (-lfoo) should be added to the LDLIBS variable instead. LDLIBS: Library flags or names given to compilers when they are supposed to invoke the linker, 'ld'.


2 Answers

sudo apt-get install libgmp3-dev

Did the trick for me.(for Ubuntu)

like image 186
Saqib R. Avatar answered Oct 04 '22 07:10

Saqib R.


I had this problem with Centos:

yum install gmp-devel.x86_64

fixed it for me for eventmachine ruby gem that would not install. Hope that helps someone.

like image 30
E.Z. Avatar answered Oct 04 '22 05:10

E.Z.