Operating System - HP-UX
1834727 Members
2680 Online
110070 Solutions
New Discussion

aC++ shared library: Unresolved Symbol: __shlinit

 
Steven J. Saunders
Occasional Advisor

aC++ shared library: Unresolved Symbol: __shlinit

I have see postings for this from several people but their doesn't seem to be a clear answer provided by those responding:

I am porting some shared libraries from AIX and Solaris for our product to HPUX. I am using the compiler to call the linker. Here is the line that gets called:

/opt/aCC/bin/aCC -b -Wl,+vshlibunsats +u1 +z -D __UNIX__ -D __HPUX__ -D __PRTALL__ pny01.o -L../../clib/ -lsymbol -lnyaamva -lCsup -lc -lC -o libpny.sl
/usr/ccs/bin/ld: Unsatisfied symbols:
__shlinit (first referenced in command line with +I option) (code)

I have updated the aC++ software to the latest version with the appropriate patches, it is now A.03.30 and all libraries and headers are up to date. Also the ld update has been applied.

From output from the linker it looks like the aCC compiler is calling the linker with a +I argument, this is a flag to set the flag to set the initializer function for a shared library. On AIX4.3.3.10 and Solaris7 it is not necessary to set an initializer function if you give the correct arguments.

Is there an override to avoid the requirement of an initializer function or do you have to have one for C++. We don't have to have one for our C libraries.

Help me please, if you can. I am browsing even more of the documentation that I can find on this subject, I have already done an exaustive Web search.

Thanks.
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor

Re: aC++ shared library: Unresolved Symbol: __shlinit

Adding -lnsl fixed a similar problem for me.
If it ain't broke, I can fix that.
Mike Stroyan
Honored Contributor

Re: aC++ shared library: Unresolved Symbol: __shlinit

There is a guide to creating aCC shared libraries at
http://docs.hp.com/hpux/onlinedocs/dev/aCC/a_03_30/distributing.htm
It covers both libraries used by programs built with aCC and libraries that will be used with programs that were not built with aCC.
Note that you should not link your library with -lc -or -lC. The -lC is particularly troublesome because it is a support library for the obsolete CC compiler. Programs cannot mix CC and aCC code.