ubuntu-18.04ldln

Ld cannot find libraries, even with ldconfig, and even ld -L -lmylib doesn't open


I got a new system, with Ubuntu 18.04.4. I am trying to install my environments to compile nvcc and I need glew glfw etc. here I am trying to install glew 1.10.0 for this program by running the make file and I get the following (other library failures during other installs as well):

$ make
cc -shared -Wl,-soname=libGLEW.so.1.10 -o lib/libGLEW.so.1.10.0 tmp/linux/default/shared/glew.o -L/usr/lib -lXmu -lXi -lGL -lXext -lX11 
/usr/bin/ld: cannot find -lXmu
/usr/bin/ld: cannot find -lXi
collect2: error: ld returned 1 exit status
Makefile:108: recipe for target 'lib/libGLEW.so.1.10.0' failed
make: *** [lib/libGLEW.so.1.10.0] Error 1

After sudo ldconfig also no change in the above

I even tried the following

$ sudo ld -verbose -L/usr/lib/x86_64-linux-gnu -lXmu
GNU ld (GNU Binutils for Ubuntu) 2.30
  Supported emulations:
   elf_x86_64
   elf32_x86_64
   elf_i386
   elf_iamcu
   i386linux
   elf_l1om
   elf_k1om
   i386pep
   i386pe
using internal linker script:

...omitting some terminal output

==================================================
attempt to open //usr/local/lib/x86_64-linux-gnu/libXmu.so failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libXmu.a failed
attempt to open //lib/x86_64-linux-gnu/libXmu.so failed
attempt to open //lib/x86_64-linux-gnu/libXmu.a failed
attempt to open //usr/lib/x86_64-linux-gnu/libXmu.so failed
attempt to open //usr/lib/x86_64-linux-gnu/libXmu.a failed
attempt to open //usr/lib/x86_64-linux-gnu64/libXmu.so failed
attempt to open //usr/lib/x86_64-linux-gnu64/libXmu.a failed
attempt to open //usr/local/lib64/libXmu.so failed
attempt to open //usr/local/lib64/libXmu.a failed
attempt to open //lib64/libXmu.so failed
attempt to open //lib64/libXmu.a failed
attempt to open //usr/lib64/libXmu.so failed
attempt to open //usr/lib64/libXmu.a failed
attempt to open //usr/local/lib/libXmu.so failed
attempt to open //usr/local/lib/libXmu.a failed
attempt to open //lib/libXmu.so failed
attempt to open //lib/libXmu.a failed
attempt to open //usr/lib/libXmu.so failed
attempt to open //usr/lib/libXmu.a failed
attempt to open //usr/x86_64-linux-gnu/lib64/libXmu.so failed
attempt to open //usr/x86_64-linux-gnu/lib64/libXmu.a failed
attempt to open //usr/x86_64-linux-gnu/lib/libXmu.so failed
attempt to open //usr/x86_64-linux-gnu/lib/libXmu.a failed
ld: cannot find -lXmu

I am really confused and I don't know how to move on from this point. Do I have to make linkers for each library or there is a simpler more correct method to doing this. And just to confirm

locate libXmu
/usr/lib/x86_64-linux-gnu/libXmu.so.6
/usr/lib/x86_64-linux-gnu/libXmu.so.6.2.0
/usr/lib/x86_64-linux-gnu/libXmuu.so.1
/usr/lib/x86_64-linux-gnu/libXmuu.so.1.0.0

Solution

  • I believe that eventhough I have been working on linux for 2 years, I am still a newbie.

    I just

    sudo apt-get install libxmu-dev
    

    &

    sudo apt-get install libxi-dev
    

    and the installation worked.