无法打开共享对象文件:无此文件或目录;在Eclipse中运行或调试 [英] Cannot open shared object file: No such file or directory; Running or Debugging in Eclipse

查看:311
本文介绍了无法打开共享对象文件:无此文件或目录;在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.


  1. 在Eclipse中,单击运行,然后单击调试配置

  2. 单击环境选项卡

  3. 单击新建

  4. 添加LD_LIBRARY_PATH并将其值设置为包含库的目录

  5. 重新启动Eclipse

  1. In Eclipse click on Run then Debug Configurations
  2. Click on the Environment Tab
  3. Click on New
  4. Add LD_LIBRARY_PATH and set its value to the directory containing the library
  5. restart Eclipse

这篇关于无法打开共享对象文件:无此文件或目录;在Eclipse中运行或调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆