How to list dependencies of c/c++ static library?

前端 未结 2 1488
南方客
南方客 2021-02-19 08:16

For a static library (.a file), how to list the module-level dependencies of it?

I know for a shared library (.so), we can use objdump or readelf to do

相关标签:
2条回答
  • 2021-02-19 08:51

    A static library have no such list of dependencies.

    A static library is nothing more than an archive of object files. And as object files doesn't know what libraries they depend on, neither can a static library.

    0 讨论(0)
  • 2021-02-19 09:07

    @Some programmer dude is right, but what you can do is build a simple program using this library statically and then check with ldd -v what are the dependencies.

    0 讨论(0)
提交回复
热议问题