【问题标题】:Could not load dynamic library /usr/lib/OGRE/RenderSystem_GL无法加载动态库 /usr/lib/OGRE/RenderSystem_GL
【发布时间】:2014-06-22 12:56:38
【问题描述】:

我正在尝试在 C++ 中运行一个程序,但出现此错误:

terminate called after throwing an instance of 'Ogre::InternalErrorException' what():  OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library /usr/lib/OGRE/RenderSystem_GL.  System Error: /usr/lib/OGRE/RenderSystem_GL.so: cannot open shared object file: No such file or directory

我已经安装了 Ogre 库,但这个问题仍然存在。关于我需要安装哪个软件包以消除此错误的任何帮助?我正在使用 Ubuntu 14.04。

【问题讨论】:

    标签: c++ ubuntu ogre


    【解决方案1】:

    Ubuntu 提供的 OGRE 库安装在/usr/lib/x86_64-linux-gnu/OGRE-1.9.0/(或-1.8.0),而不是/usr/lib/OGRE/

    您的程序正在尝试使用绝对路径的dlopen 或类似名称。如果您无法修改程序以使其使用新路径(或者,更好的是,它让链接器决定使用什么路径),最简单的解决方案是创建一个符号链接:

    sudo ln -s /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/ /usr/lib/OGRE/
    

    【讨论】:

      【解决方案2】:

      尝试 ldd YOUR_BINARY 看看它是否可以找到它需要的动态链接库。

      【讨论】:

      • 这给了我一个包含很多库名称的输出。这对我有什么帮助?
      • 可能有像 libogre.so 这样的名称。你可以使用 locate 或 find 来搜索你的文件系统中是否有这样的文件。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-01-05
      • 2018-01-15
      • 2017-07-29
      • 2018-12-14
      • 2018-03-14
      • 2018-07-21
      • 1970-01-01
      相关资源
      最近更新 更多