0

i want to run a "make" command in linux terminal in order to use some c++ libs. Unluckily while running the "make" an error appears saying it cannot find the requested libs.

Here the relevant makefiles: enter image description here

Here are the files in my filesystem which should be linked. enter image description here

Why does makefile not find the libraries ? Thanks for all answers in advance

PatyKerry
  • 3
  • 1
  • 3

1 Answers1

0

Try to modify your Makefile for -lgmp rather than -libgmp

In background the compiler adds the 'lib' onto the name as well as the extension .so and similar stuff.

Try running the following to get an overview of what the linker is trying to do:

ld -L [yourincludepath] -lgmp --verbose

Such resolution issues might be due to the fact you are trying to link a 64bit library with a 32bit application? Try installing a proper XX-bits of the lib maybe?

Try to add -m option (machine dependency):

ld -melf_i386 -L /usr/lib/i386-linux-gnu/ -lgmp --verbose

Other values which might be supported on your side:

elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu i386linux elf_l1om elf_k1om i386pep i386pe

More info:

usr/bin/ld: cannot find -l<nameOfTheLibrary>

Fabien
  • 4,862
  • 2
  • 19
  • 33
  • i already tried -lgmp and -lntl. It did not work. Any other suggestion ? – PatyKerry Jun 21 '17 at 11:16
  • that was useful. Right now it says: attempt to open /usr/local/lib/libntl.so failed attempt to open /usr/local/lib/libntl.a succeeded it looks like a libntl.so file is missing. I guess i have to try another version of the lib. I am trying to use http://www.shoup.net/ntl/download.html. – PatyKerry Jun 21 '17 at 11:50
  • Yes, beware of auto-deployed libraries, sometimes you just forget to very accurately install the library for the proper system architecture. I am glad I was somehow helpful to you! – Fabien Jun 21 '17 at 11:52