bash libGLEW.so.1.9:无法打开共享对象文件。无此文件或目录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22134271/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 09:46:44  来源:igfitidea点击:

libGLEW.so.1.9: cannot open shared object file. no such file or directory

bashglew

提问by Adam Van Oijen

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:

我正在尝试运行我制作的应用程序 - 它使用了glew。它编译得很好,但是当我尝试运行它时,出现错误:libGLEW.so.1.9:无法打开共享对象文件。无此文件或目录。我已经检查过是否有它,它在 usr/lib64 中。我在互联网上尝试了其他修复程序,并将 /etc/ld.so.conf 编辑为:

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.

然后运行 ​​ldconfig,但终端吐出一大堆乱码。

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

有人可以帮忙吗?顺便说一句,抱歉没有提供信息的标题。

采纳答案by Adam Van Oijen

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.configfile, I tried just including the path

ld.so.config文件中,我尝试只包含路径

/usr/lib64/

回答by Ярослав Рахматуллин

You should read man ldconfig:

你应该阅读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.

该文件应该是自动生成的。在 Gentoo 上,它只包含目录。

$ 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 ...

看着 /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.

根据我所见,您应该检查 /etc/ld.so.conf.d/ 中的文件,将其中一个复制到一个新文件中,例如 glew.conf,然后将新文件中的路径修改为指向该文件夹lib文件在哪里。