I have a linker error where it says undefined reference to a function. The shared library where I expect the function to be has that function name ( I checked through nm -s ) so now the next thing I want to see is if the function parameters are correct. How do I see the type and number of parameters for a function in a shared object file ?
EDIT: So the problem it came to be was: I was trying to create a C++ shared object file by linking a shared C object, but in the C++ source I did not include the header inside "extern "C" " block, so it was not able to find those symbols, Thanks to all who replied to this question. This question is resolved now.
However, you might be able to read the SO file as a text file by opening it in a text editor like Leafpad, gedit, KWrite, or Geany if you're on Linux, or Notepad++ on Windows.
A shared object is an indivisible unit that is generated from one or more relocatable objects. Shared objects can be bound with dynamic executables to form a runable process. As their name implies, shared objects can be shared by more than one application.
These shared objects are named with the extension . fso and are stored on the server in a subdirectory of the application that created the shared object. Adobe Media Server creates these directories automatically; you don't have to create a directory for each instance name.
so (short for "shared object"). Shared libraries are the most common way to manage dependencies on Linux systems. These shared resources are loaded into memory before the application starts, and when several processes require the same library, it will be loaded only once on the system.
You can use nm
with the --demangle
option:
nm -s --demangle libWhatever.so
trying that out on a sample .so gives me output such as
00005820 T detail::print_(std::ostream&, cv::Mat const&, std::string const&)
T
just means that it is in the object files used to make the .so
and does not need to be resolved by the linker.
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