Question

I am trying to run an application that I made -that uses glew. It compiles fine, but when I try to run it, I get the error: libGLEW.so.1.9: cannot open shared object file. no such file or directory. I've checked to see if I have it, and it's in usr/lib64. I've tried other fixes on the internet, and I edited the /etc/ld.so.conf to this:

include /etc/ld.so.conf.d/*.conf /usr/lib64/libGLEW.so.1.9(adding this second path)

and then ran ldconfig, but the terminal spat out a whole lot of gibberish.

Can someone please help? btw, sorry about the uninformative title.

Was it helpful?

Solution 2

Turns out it was a simple fault.

Instead of adding the path to specifically include

/usr/lib64/libGLEW.so.1.9

in the ld.so.config file, I tried just including the path

/usr/lib64/

OTHER TIPS

You should read man ldconfig:

DESCRIPTION

     ldconfig creates the necessary links  and  cache  to  the  most  recent
     shared  libraries  found  in  the  directories specified on the command
     line, in the file /etc/ld.so.conf, and in the trusted directories (/lib
     and  /usr/lib).  The cache is used by the run-time linker, ld.so or ld-
     linux.so.  ldconfig checks the header and filenames of the libraries it
     encounters  when  determining  which  versions  should have their links
     updated.

That file should be auto-generated. On Gentoo, it contains only directories.

$ cat /etc/ld.so.conf
# ld.so.conf autogenerated by env-update; make all changes to
# contents of /etc/env.d directory
/lib64
/usr/lib64
/usr/local/lib64
/lib32
/usr/lib32
/usr/local/lib32
/lib
/usr/lib
/usr/local/lib
include ld.so.conf.d/*.conf
/usr/lib32/OpenCL/vendors/nvidia
/usr/lib64/OpenCL/vendors/nvidia
/usr/lib32/opengl/nvidia/lib
/usr/lib64/opengl/nvidia/lib
/usr/lib64/qca2
/usr/lib64/qt4
/usr/lib32/qt4
/usr/lib/qt4
/usr/lib/postgresql
/usr/lib64/postgresql
/usr/lib64/postgresql-9.3/lib64/
/usr/games/lib64
/usr/games/lib32
/usr/games/lib

Looking at /etc/env.d ...

$ grep LD /etc/env.d/*
/etc/env.d/00basic:LDPATH='/lib64:/usr/lib64:/usr/local/lib64:/lib32:/usr/lib32:/usr/local/lib32:/lib:/usr/lib:/usr/local/lib'
/etc/env.d/00glibc:LDPATH="include ld.so.conf.d/*.conf"
/etc/env.d/03opencl:LDPATH="/usr/lib32/OpenCL/vendors/nvidia:/usr/lib64/OpenCL/vendors/nvidia"
/etc/env.d/03opengl:LDPATH="/usr/lib32/opengl/nvidia/lib:/usr/lib64/opengl/nvidia/lib"
/etc/env.d/44qca2:LDPATH="/usr/lib64/qca2"
/etc/env.d/44qt4:LDPATH="/usr/lib64/qt4:/usr/lib32/qt4:/usr/lib/qt4"
/etc/env.d/44qt4-emul:LDPATH=/usr/lib32/qt4
/etc/env.d/50postgresql:LDPATH="/usr/lib/postgresql:/usr/lib64/postgresql:/usr/lib64/postgresql-9.3/lib64/"
/etc/env.d/90games:LDPATH="/usr/games/lib64:/usr/games/lib32:/usr/games/lib"

Judging by what I see you should examine the files in /etc/ld.so.conf.d/, copy one of them into a new file such as glew.conf, and modify the path within the new file to point to the folder where the lib file is.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top