What is the best way to find what library a function may belong to?
When building source code, I sometimes get "undefined reference to" errors. When they are function calls, I'd like to know what libraries need to be linked in more easily than my usual guessing game. Any ideas?
-Chenz
As far as I know you're pretty much out of luck as far as an automated solution goes.
You could try dumping all the symbols from all you usual libraries to file and grepping through the results to find the one you're looking for. You'd only have to do the dumping infrequently
I think the unix tool "nm" is what you're looking for. I don't know about windows, sorry
Something like the following should do it on Linux:
find . -name "*.so" -print0 | xargs -0 nm -A | egrep ' [TWDB] ' > symbols.out
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With