Operating System - Linux
1753625 Members
5274 Online
108797 Solutions
New Discussion юеВ

Re: Mixing ANSI C and aC++ compilers

 

Mixing ANSI C and aCC compilers

If anyone has linked a shared library with the C program using ANSI C compiler on HP-UX and getting following types of errors while running the executable created

aCC runtime: Error 215 from shl_findsym(/usr01/home/libxxxxx.sl.21,_shlInit)
/usr/lib/dld.sl: Unresolved symbol: __tcerr (data) from /usr01/home/xxxxxx.sl
/usr/lib/dld.sl: Unresolved symbol: __tcout (data) from /usr01/home/xxxxxx.sl
/usr/lib/dld.sl: Unresolved symbol: __stl_tree_mutex (data) from /usr01/home/xxxxxxx.sl
/usr/lib/dld.sl: Unresolved symbol: init__14HPMutexWrapperFv (code) from /usr01/home/xxxxxx.sl
/usr/lib/dld.sl: Unresolved symbol: lock__14HPMutexWrapperSFPv (code) from /usr01/home/xxxxxx.sl
/usr/lib/dld.sl: Unresolved symbol: unlock__14HPMutexWrapperSFPv (code) from /usr01/home/xxxxxx.sl
/usr/lib/dld.sl: Unresolved symbol: __dt__14HPMutexWrapperFv (code) from /usr01/home/xxxxxx.sl
/usr/lib/dld.sl: Unresolved symbol: __dt__13Iostream_initFv (code) from /usr01/home/xxxxxxxx.sl
/usr/lib/dld.sl: Unresolved symbol: __ct__13Iostream_initFv_1 (code) from /usr01/home/xxxxxxx.sl
/usr/lib/dld.sl: Unresolved symbol: ref__20t_ostream_withassignFv (code) from /usr01/home/xxxxxxx.sl
/usr/lib/dld.sl: Unresolved symbol: __ls__7ostreamFPCc (code) from /usr01/home/xxxxxxxxxx.sl
/usr/lib/dld.sl: Unresolved symbol: endl__FR7ostream (code) from /usr01/home/xxxxxxxxxxx.sl
/usr/lib/dld.sl: Unresolved symbol: __ls__7ostreamFi (code) from /usr01/home/xxxxxxxxx.sl
/usr/lib/dld.sl: Unresolved symbol: __ls__7ostreamFUi (code) from /usr01/home/xxxxxxxxx.sl
/usr/lib/dld.sl: Unresolved symbol: ls_complicated__7ostreamFUc (code) from /usr01/home/xxxxxxxxxxxxxx.sl
/usr/lib/dld.sl: Unresolved symbol: __ls__7ostreamFl (code) from /usr01/home/xxxxxxxxxxxx.sl
/usr/lib/dld.sl: Unresolved module for symbol: [Vftptr_Q2_7icu_2_124ForwardCharacterIterator]key: (data) from /usr01/home/xxxxxxxxx.sl.21
Abort (coredump)


To resolve this type of error, check if shared library you are using is created using aCC compiler. If libraries are created using aCC compilers then there are three ways to solve the problem.

1. Use aCC compiler for the linking.
2. If you still want to continue with the ANSI C compiler then

a.out must be linked with the HP aC++ runtime libraries in the following order:
-lstd -lstream -lCsup -lm -lcl -ldld

To better understand read the following link http://docs.hp.com/en/4311/distributing.htm

3. Use LD_PRELOAD command to preload the libraries mentioned in option 2 (lstd -lstream -lCsup -lm -lcl тАУldld

). But LD_PRELOAD option if set in .profile may affect other programs. So better use it while running the program creating problem.
2 REPLIES 2
Jan van den Ende
Honored Contributor

Re: Mixing ANSI C and aCC compilers

Hi ??

Welcome to the OpenVMS forum, the forum that deals with the most wonderful OS on the world!

Now, in VMS that would be an easy question, but you asked:

>>>
If anyone has linked a shared library with the C program using ANSI C compiler
!!!
on HP-UX
!!!
<<<

and I think the answers you will get in the HPUX forum would be much more specific to your situation!

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Dennis Handly
Acclaimed Contributor

Re: Mixing ANSI C and aC++ compilers

You might want to close this since you provided your own solution and pointed to the official web page. Though you should point to the latest version:
http://www.docs.hp.com/en/7762/5991-4874/distributing.htm