Runtime error: can't find in /usr/lib64 directory

I’m having an error when trying to run my application. The file exists in the /usr/lib64 folder but I can’t figure out how to fix the error

$ ./release/runme 
./release/runme: error while loading shared libraries: cannot open shared object file: No such file or directory
$ find /usr -name 'libGLEW*'
find: `/usr/lost+found': Permission denied
$ ldd ./release/runme =>  (0x00007fffd6388000) => /usr/local/lib/ (0x00007f2395f13000) => /usr/local/lib/ (0x00007f2395cee000) => /usr/lib/nvidia-310/ (0x00007f23959ca000) => not found => /usr/lib/x86_64-linux-gnu/ (0x00007f23956c7000) => /lib/x86_64-linux-gnu/ (0x00007f23953c1000) => /lib/x86_64-linux-gnu/ (0x00007f23951ab000) => /lib/x86_64-linux-gnu/ (0x00007f2394de3000) => /lib/x86_64-linux-gnu/ (0x00007f2394bc5000) => /lib/x86_64-linux-gnu/ (0x00007f23949c1000) => /lib/x86_64-linux-gnu/ (0x00007f23947b9000) => /usr/lib/nvidia-310/tls/ (0x00007f23945b5000) => /usr/lib/nvidia-310/ (0x00007f23920c2000) => /usr/lib/x86_64-linux-gnu/ (0x00007f2391d88000) => /usr/lib/x86_64-linux-gnu/ (0x00007f2391b75000)
    /lib64/ (0x00007f2396222000) => /usr/lib/x86_64-linux-gnu/ (0x00007f2391957000) => /usr/lib/x86_64-linux-gnu/ (0x00007f2391752000) => /usr/lib/x86_64-linux-gnu/ (0x00007f239154c000)
$ ls -aR /usr/lib64/
.  ..  libGLEW.a  pkgconfig

.  ..  glew.pc

As you can see, the GLEW files are essentially the only things in the /usr/lib64 directory. I have issued the ldconfig command as root but that has not fixed the problem. It seems like something needs to be added to /etc/ or one of the other conf files in /etc/, or maybe I can just move these GLEW files into /usr/lib/x86_64-linux-gnu/ ?

ldconfig only scans the directories which are listed in, or in files included from it. If GLEW is the only library in /usr/lib64, that suggests that your Linux distribution doesn’t use that directory, so probably doesn’t reference it. You can either modify or move the GLEW libraries. If the libraries aren’t part of the distribution, they should probably go somewhere under /usr/local rather than under /usr.

Also, verify that your application is 64-bit, not 32-bit (run “file ./release/runme”). If it’s 32-bit, it’s not going to link with those 64-bit libs no matter what you do.

Assuming it is 64-bit though, GClements has you covered. You can test to see if those libs would work but just aren’t being searched with “env LD_LIBRARY_PATH=/usr/lib64 ./release/runme”. If that works, then it’s just updating your dynamic link library path cache, and he tells you how. If it doesn’t, then I would “ls -l /usr/lib64/libGLEW*” and verify that is an actual file, or is a symlink that points (directly or indirectly) to the actually file … probably /usr/lib64/

Okay I was able to do something I think is equivalent to 'env LD_LIBRARY_PATH=/usr/lib64 ./release/runme: I use Scons for building and was able to set an environment variable RPATH = ‘/usr/lib64’ in my Sconscript file. With this modification after rebuilding I was able to run with no errors.

When I finally do try and distribute the application should the library files such as libGLEW be moved into the executable directory itself? (assuming it’s being run from a machine that hasn’t built GLEW from makefile)

Which distro, if I may ask?

Just moved from Mint 12 to Mint 15

32-bits/64-bits? I guess, since you have a /usr/lib64 directory, you’re running a 32-bit version. If so, why? Do you have a specific requirement to run a 32-bit installation? Did you install GLEW from the repo or compiled it yourself?

No. Linux isn’t windows. Applications don’t get packaged inside a single directory. Binaries go in “bin”, libraries in “lib” (or lib32/lib64 on multi-arch setups), etc. Note that the loader won’t, by default, search the directory containing the executable for libraries.
As Mint has an official package for GLEW, you shouldn’t be bundling it, nor linking against a version which you built yourself.

As Mint has an official package for GLEW, you shouldn’t be bundling it, nor linking against a version which you built yourself.[/QUOTE]

Silly me, I didn’t even search for glew packages. I’m guessing the one I wanted was libglew-dev.

No it’s the 64 bit version. I just went to the glew website and it didn’t mention using apt/aptitude so I just downloaded the zip and ran ‘sudo make install’ from the directory. This created the lib64 directory and the glew files were the only files in there.

sudo apt-get install libglew-dev

(since quantal. before it’d be libglew1.6-dev or libglew1.5-dev)

[QUOTE=thokra;1254498]sudo apt-get install libglew-dev

(since quantal. before it’d be libglew1.6-dev or libglew1.5-dev)[/QUOTE]

Err, yeah I was about to do this, but I realized I don’t know how to revert what I’ve done by running make install with the glew makefile… It’s working for now, should I just leave it, or try and clean up before doing the proper package install?


Ok I was able to do ‘sudo make uninstall’ and install with apt. Thanks!

Just to spare you further confusion, read up on makefiles. It’s very advantageous to at least understand how to use them.

For development, you typically need both the “base” package (e.g. libglew) and the -dev package (e.g. libglew-dev), although installing the latter will probably install the former automatically. End users will only need the base package to run the program.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.