Urgent: Need info on C++ Linking

S

sunil

Hi,
We have lot of c and fortran archive libraries that have complex
dependencies. We have different server tasks that use some of these
libraries. We have developed a tool inhouse that links server tasks by
continuously iterating until it figures out the correct library order.
Recently we introduced some C++ legacy libraries. I am completely new
to C++ linking. Is there some tutorial that can explain the nuances of
C++ linking? We do links on DIGITAL UNIX, SUN Solaris, IBMS and HP
UNIX platforms. I compiled same cpp source files on all four platforms
but was suprised to see that the symbol information differs widely
across all four platforms. For C/FORTRAN code, it is pretty
straightforward to look at o/p from nm command and see what global
(data/function) symbols a given object file/library exports. But that
doesnt seem to be case with C++. The global symbols exported on IBMs
and HPUNIXes is drastically different from what I see on other
architectures. I have very little knowledge of C++. I would appreciate
if someone out there can point me to some documents that can help me
get started.
Thanks a lot,
Sunil
 
J

Jack Klein

Hi,
We have lot of c and fortran archive libraries that have complex
dependencies. We have different server tasks that use some of these
libraries. We have developed a tool inhouse that links server tasks by
continuously iterating until it figures out the correct library order.
Recently we introduced some C++ legacy libraries. I am completely new
to C++ linking. Is there some tutorial that can explain the nuances of
C++ linking? We do links on DIGITAL UNIX, SUN Solaris, IBMS and HP
UNIX platforms. I compiled same cpp source files on all four platforms
but was suprised to see that the symbol information differs widely
across all four platforms. For C/FORTRAN code, it is pretty
straightforward to look at o/p from nm command and see what global
(data/function) symbols a given object file/library exports. But that
doesnt seem to be case with C++. The global symbols exported on IBMs
and HPUNIXes is drastically different from what I see on other
architectures. I have very little knowledge of C++. I would appreciate
if someone out there can point me to some documents that can help me
get started.
Thanks a lot,
Sunil

Sorry, wrong group. Linkers are not a language issue, and C++ never
heard of FORTRAN. I'm not sure where the best place to ask this
question would be, but it is off-topic here.
 
M

Malte Starostik

sunil said:
Hi,
[...] I am completely new
to C++ linking. Is there some tutorial that can explain the nuances of
C++ linking? We do links on DIGITAL UNIX, SUN Solaris, IBMS and HP
UNIX platforms. I compiled same cpp source files on all four platforms
but was suprised to see that the symbol information differs widely
across all four platforms. For C/FORTRAN code, it is pretty
straightforward to look at o/p from nm command and see what global
(data/function) symbols a given object file/library exports. But that
doesnt seem to be case with C++. [...]

In C++, symbol names are "mangled" to include not only their plain
names, but also their type. How exactly this is done is
implementation-defined, that's why you see those differences between
toolsets for different platforms. Some versions of nm have an option to
demangle C++ symbol names to human readable form or your toolset might
include something like "c++filt" to pipe nm's output through. Apart
from that, linking C++ objects isn't really any different than linking C
objects. Either way, this is compiler/linker-specific and not a C++
language issue; if you have any further questions about this,
comp.unix.programmer seems to be a more adequate place to me.

Regards,
Malte
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,183
Messages
2,570,967
Members
47,516
Latest member
ChrisHibbs

Latest Threads

Top