我怎样才能找出库是家庭对一个给定的对象? [英] How can I find out which library is home to a given object?
问题描述
我在Fortran和C上运行Irix的6.5 SGI编程,但是这应该是适用于所有类Unix系统。我如何找到我需要的时候,我得到一个未解决的文本符号链接错误链接到我的计划,库?下面就是我从链接器看到的例子:
I'm programming in FORTRAN and C on an SGI running Irix 6.5, but this should be applicable to all Unix-like systems. How do I find which library I need to link to my program when I get an "unresolved text symbol" link error? Here's an example of what I'm seeing from the linker:
ld32: ERROR 33 Unresolved text symbol "ortho2_" -- first referenced by ./libfoo.a
我只需要知道需要哪些库,或者是有一些工具或命令,可以帮助我想出解决办法?
Do I just have to know which libraries are required, or is there some tool or command that can help me figure this out?
推荐答案
您可以使用纳米
命令从一个共享库列出动态符号:
You can use the nm
command to list the dynamic symbols from a shared library:
nm -D /lib/libc.so.6
然后的grep
的符号,你正在寻找。省略静态库的-D。你可以使用这个在一个循环或xargs的扫描多个图书馆。
and then grep
for the symbol you are looking for. Omit the -D for static libraries. You can use this in a loop or with xargs to scan multiple libraries.
我通常只使用谷歌(假设符号是从公开可用的库)。
I usually just use google (assuming the symbol is from a publicly available library).
这篇关于我怎样才能找出库是家庭对一个给定的对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!