本文介绍了/ usr / bin / ld:找不到-lemu的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我试图安装一个应用程序。在编译期间,它会失败并显示以下错误: pre $ / usr / bin / ld:找不到-lemu code> 我已经安装了libemu库,现在它驻留在/ opt / libemu /中。但是,当我尝试编译我的应用程序时,找不到该库。有没有什么方法可以解决这个问题? 编辑:它也看起来像是导致:它也看起来像make文件正在编译与以下内容: gcc -pthread -shared -Wl,-O1 -Wl, -Bsymbolic函数 build / temp.linux-x86_64-2.6 / libemu_module.o -L ​​/ opt / libemu / lib -lemu -o build / lib.linux-x86_64-2.6 / libemu.so 我尝试将我的LD_LIBRARY_PATH设置为/ opt / libemu,但仍然无效 - 解决方案您需要告诉链接器它在哪里: gcc stuff -L / opt / libemu -lemu gcc stuff /opt/libemu/libemu.a 其中东西是您正常的编译/链接选项文件等。 您也可以在LIBRARY_PATH环境变量中指定库路径: LIBRARY_PATH = / opt / libemu export LIBRARY_PATH ,然后再运行构建。另一个选择是通过运行来查看gcc在哪里查找库: gcc --print-search-dirs 并将您的图书馆放入其中一个列出的目录中。 编辑:从您的最新信息中确实不清楚您正在尝试构建的内容。你是否试图将一个静态库变成一个共享库?最重要的是 - 复制到/ opt / libemu目录中的库文件的确切文件名是什么? I am attempting to install an application. During compilation it fails with the following error:/usr/bin/ld: cannot find -lemuI have installed the libemu library, and it now currently resides in /opt/libemu/. However, when I try and compile my application the library is not found. Is there any way to correct this?EDIT: It also looks like the make is resulting in:It also looks like the make file is compiling with the following:gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functionsbuild/temp.linux-x86_64-2.6/libemu_module.o-L/opt/libemu/lib -lemu -o build/lib.linux-x86_64-2.6/libemu.soI have tried setting my LD_LIBRARY_PATH to /opt/libemu, still doesn't work - fails with the error mentioned above. 解决方案 You need to tell the linker where it is:gcc stuff -L/opt/libemu -lemuor:gcc stuff /opt/libemu/libemu.awhere stuff is your normal compile/link options files etc.You can also specify library paths in the LIBRARY_PATH environment variable:LIBRARY_PATH=/opt/libemuexport LIBRARY_PATHbefore you run your build. Yet another option is to see where gcc looks for libraries by running:gcc --print-search-dirsand put your library in one of the listed directories.Edit: It is really not clear from your latest info what you are trying to build. Are you trying to turn a static library into a shared library? Most important - What is the exact filename of the library file you have copied into the /opt/libemu directory? 这篇关于/ usr / bin / ld:找不到-lemu的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-19 01:34