How can I dump symbols in .la file on Ubuntu Linux?
How can I dump symbols in .la file on Ubuntu Linux?
I get this linking error:
main.c:(.text+0xbfb): undefined reference to `Browser_new'
And I think my main.c is linking against libwebkit-1.0.la. So how can I find out if libwebkit-1.0.la has the symbol 'Browser_new'?
CXXLD libwebkit-1.开发者_如何学C0.la
CCLD Programs/GtkLauncher
The problem could well be that you are using C and libwebkit has C++ symbols. The C++ symbol names will be mangled compared to what you may see in the include files.
Anyway, to answer the question: .la is a libtool library. Usually it points to a .so file:
$ grep dlname libwebkit-1.0.la
dlname='libwebkit-1.0.so'
And then on the .so file you can use nm to show dynamic symbols:
$ nm -D libwebkit-1.0.so
...
If this is a C++ library, then you can use the -C flag to demangle the C++ function names.
$ nm -D -C libwebkit-1.0.so
精彩评论