简体   繁体   English

共享库的编译问题

[英]Compiling problems with shared libraries

I try to compile some code, which works on my main-pc under ubuntu 14.04 LTS. 我尝试编译一些代码,这些代码可在ubuntu 14.04 LTS下的主PC上使用。 Now I want to use a little board(Zedboard) with linux to control a EnOceanreceiver. 现在我想在Linux上使用一个小板(Zedboard)来控制EnOceanreceiver。
I use Linaro 12.11 and programm in C++. 我使用Linaro 12.11和C ++编程。

If I compile, there is no error. 如果我进行编译,则没有错误。 But if I want to start the programm comes: error while loading shared libraries: libEOLink.so.0: cannot open shared object file: No such file or directory 但是,如果要启动程序,则会出现:加载共享库时出错:libEOLink.so.0:无法打开共享对象文件:没有这样的文件或目录

My Makefile looks like: 我的Makefile看起来像:

all: EnOcean.cpp
   g++ -I/homelinaro/EOLink EnOcean.cpp -o EnOcean -L/usr/local/lib -lEOLink

I found the data under /usr/local/lib but it doesn't help if with or not. 我在/ usr / local / lib下找到了数据,但是无论是否使用都没有帮助。

Thanks for help! 感谢帮助!

If libEOLink.so.0 can be found in /usr/local/lib, you shouldn't need to add it to LD_LIBRARY_PATH as this should already be part of the path. 如果可以在/ usr / local / lib中找到libEOLink.so.0,则无需将其添加到LD_LIBRARY_PATH因为它已经是路径的一部分了。 It's possible that library relies on other librari(es) that are not found. 库可能依赖于其他未找到的库。 To determine whether this is the case, run: 要确定是否是这种情况,请运行:

ldd /usr/local/lib/libEOLink.so.0

If any dependencies are not found, it will be reported. 如果未找到任何依赖项,则将报告它。

I also assume you combiled libEOLink for your target system. 我还假设您为目标系统编译了libEOLink。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM