finding the library in which symbol is defined.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I use Linux, g++ v3.3, and python v3.3.3

I'm in the process of struggling with unresolved reference link errors in a cpp program that is under development.

The program uses a shared library which I have constructed.
This library in turn uses boost.python and the Python C API.

The link errors all concern functions from the later, which start with "Py".

First question.
Is it normal that a cpp client of a shared library share the resource requirements of the shared library?


I am aware that on windows, with msvc 6.0, this represents an abnormal erroneous condition. It means that the cpp client is using concrete classes cross a dll boundary.

Does Linux share this "feature"?

Second question.

What is the difference between "normal" symbols and dynamic symbols?
The later are obtainable from a library using the "--dynamic" option of the nm utility.


I've constructed a script that utilizes nm to find library modules defining specific symbols. It is:
#!/bin/sh
# Find the shared libraries that define specific symbol
# arg 1 - the root directory from which to search
# arg 2 - the library name(s) to search for
# arg 3 - the symbol to search for.
find $1 -name "$2" -exec nm --print-file-name '{}' ';' | grep " [^ U] ""$3"


Third question
Note the use of [ ^ U]. This matches only lines from nm that represent references of the symbols. I'm not sure that is what I want. I wish to find only symbols that lead to resolution of my linker errors. Should I instead by search for a specific type, maybe like "D"?




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux