/ usr / bin / ld:找不到-lemu [英] /usr/bin/ld: cannot find -lemu
问题描述
我试图安装一个应用程序。在编译期间,它会失败并显示以下错误:
pre $ / usr / bin / ld:找不到-lemu
我已经安装了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 -lemu
I 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-functions
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
I 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 -lemu
or:
gcc stuff /opt/libemu/libemu.a
where stuff
is your normal compile/link options files etc.
You can also specify library paths in the LIBRARY_PATH environment variable:
LIBRARY_PATH=/opt/libemu
export LIBRARY_PATH
before you run your build. Yet another option is to see where gcc looks for libraries by running:
gcc --print-search-dirs
and 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!