Operating System - HP-UX
1830168 Members
6191 Online
109999 Solutions
New Discussion

Using aCC shared libs with cc

 
SOLVED
Go to solution
Andrew Herrmann
Occasional Advisor

Using aCC shared libs with cc

I compiled a simple "hello world" program in C++ using aCC (options -b,+z). This is a simple shared library that contains a function called hw which displays the string "Hello World."

If I build a test program using aCC that calls hw and uses my "Hello World" shared library, everything works great.

If I build a test program that using cc INSTEAD of aCC, I receive the following error message when I try to run it:

/usr/lib/dld.sl: unresolved symbol __shlinit (code) from ./libhello

Note: I've used an extern "c" on the function hw to prevent name mangling.

Is it possible to use an aCC shared library from a cc compiled program? If so, what am I doing wrong?

Thanks,

Andy
2 REPLIES 2
Umapathy S
Honored Contributor

Re: Using aCC shared libs with cc

hi Andy,

Check this link. This may help to see your problem.

http://devrsrc1.external.hp.com/STK/impacts/i121.html

HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Mike Stroyan
Honored Contributor
Solution

Re: Using aCC shared libs with cc

An aCC built shared library needs to be linked with the c++
runtime libraries if it will be used by a program linked without
aCC. The details are described in this document (for the
A.03.37 release of aCC)
http://docs.hp.com/hpux/onlinedocs/2213/distributing.htm#distributing
You can run "aCC +help" to view the documentation for the release that you have installed.