无法打开共享对象文件:无此文件或目录;在Eclipse中运行或调试

编程入门 行业动态 更新时间:2024-10-28 12:31:29
本文介绍了无法打开共享对象文件:无此文件或目录;在Eclipse中运行或调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在Ubuntu上,我在Eclipse中有一个C ++应用程序。应用程序可以正常编译,并且可以从命令行运行该应用程序。

On Ubuntu, I have a C++ app in Eclipse. The application compiles fine and I can run the app from the command line.

但是当我尝试调试它或使用Eclipse运行它时,错误:

But when I try to debug it or run it with Eclipse, the error :

无法打开共享库文件:没有这样的文件或目录

我已经在bashrc文件中设置了LD_LIBRARY_PATH,并且还在运行配置和调试配置中都将LD_LIBRARY_PATH环境变量设置为:

I've set LD_LIBRARY_PATH in my bashrc file and also set an LD_LIBRARY_PATH environment variable in both the Run Configuration and Debug Configuration to :

/ home / behlingb / Documents / api_libs / FileGDB_API / lib

/home/behlingb/Documents/api_libs/FileGDB_API/lib

什么

UPDATE

此应用程序仅需要一个共享库文件,该文件来自第三方API下载。我只是发现,如果将共享库放在可执行文件所在的目录中,它将在Eclipse中调试。有没有一种方法可以指定一个不同的目录,这样我就不必为每个项目都复制文件了?

There is only one shared object file this application requires, and that file is from a 3rd party API download. I just found that if I place the shared object inside the directory the executable is in, it will debug in Eclipse. Is there a way to specify a different directory so I dont have to copy the file for every project?

推荐答案

我正在使用开普勒版本的Eclipse。

I'm using the Kepler version of Eclipse.

  • 在Eclipse中,单击运行,然后单击调试配置
  • 单击环境选项卡
  • 单击新建
  • 添加LD_LIBRARY_PATH并将其值设置为包含库的目录
  • 重新启动Eclipse
  • In Eclipse click on Run then Debug Configurations
  • Click on the Environment Tab
  • Click on New
  • Add LD_LIBRARY_PATH and set its value to the directory containing the library
  • restart Eclipse
  • 更多推荐

    无法打开共享对象文件:无此文件或目录;在Eclipse中运行或调试

    本文发布于:2023-10-09 10:13:36,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1475469.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:文件   无法打开   无此   对象   目录

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!