$g++ -o intro intro.o -L -Wl,-rpath-link -lnotes -lm -lnsl -lpthread -lc -lresolv -ldl/usr/bin/ld: cannot find -lnotescollect2: ld returned 1 exit status
但是,库似乎就在那里(事实上,我把它放在那里通过将/ opt / ibm / lotus / notes包含在/etc/ld.so.conf.d/中的文件中并运行ldconfig):
$ldconfig --print-cache | grep libnotes 361: libnoteswc.so (libc6) => /opt/ibm/lotus/notes/libnoteswc.so362: libnotes.so (libc6) => /opt/ibm/lotus/notes/libnotes.so解决方法
GCC does not specify a runpath so that the dynamic linker can find dynamic librarIEs at runtime…Yet another option,that works on a few platforms,is to hard-code the full pathname of the library into its soname. This can only be accomplished by modifying the appropriate .ml file within libstdc++/config (and also libg++/config,if you are building libg++),so that $(libdir)/ appears just before the library name in -soname or -h options.
http://gcc.gnu.org/faq.html#rpath
总结以上是内存溢出为你收集整理的linux – 为什么GNU链接器找不到带-l的共享对象?全部内容,希望文章能够帮你解决linux – 为什么GNU链接器找不到带-l的共享对象?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)