usr / bin / ld:找不到-l< nameOfTheLibrary> [英] usr/bin/ld: cannot find -l<nameOfTheLibrary>
本文介绍了usr / bin / ld:找不到-l< nameOfTheLibrary>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图编译我的程序,它返回这个错误:
I'm trying to compile my program and it returns this error :
usr/bin/ld: cannot find -l<nameOfTheLibrary>
<并链接到我的图书馆,这是我位于另一个目录上的图书馆的符号链接。
in my makefile I use the command g++
and link to my library which is a symbolic link to my library located on an other directory.
有添加选项让它工作吗?
Is there an option to add to make it work please?
推荐答案
如果您的库名称是libxyz.so,它位于路径:
If your library name is say libxyz.so` and it is located on path say:
/ home / user / myDir
,然后将其链接到您的计划:
then to link it to your program:
g++ -L/home/user/myDir -lxyz myprog.cpp -o myprog
这篇关于usr / bin / ld:找不到-l< nameOfTheLibrary>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文