Operating System - HP-UX
1833875 Members
1993 Online
110063 Solutions
New Discussion

Re: link error when using aCC -AA

 
Venkat Chandrasekaran
Occasional Advisor

link error when using aCC -AA

has anyone seen this? I am using HP-UX 11, compiler version aCC: HP ANSI C++ B3910B A.03.33 with all the latest patches installed. When I link with aCC -AA (ANSI C++) I get unsatisfied link errors like the following:

ostream::complicated_put(char) (first referenced in ../../../../lib/libdmcommon.a(dmvbpar.o)) (code)
cout (first referenced in vbtest.o) (data)
istrstream::istrstream(const char *,int)%1 (first referenced in ../../../../lib/libdmcommon.a(dmvbpar.o)) (code)
istream::operator >>(unsigned int &) (first referenced in ../../../../lib/libdmcommon.a(dmvbpar.o)) (code)
endl(ostream &) (first referenced in ../../../../lib/libdmcommon.a(dmvbpar.o)) (code)
ostream::operator <<(const char *) (first referenced in vbtest.o) (code)
ostream::operator <<(unsigned int) (first referenced in ../../../../lib/libdmcommon.a(dmvbpar.o)) (code)
ostream::operator <<(int) (first referenced in vbtest.o) (code)
istrstream::~istrstream() (first referenced in ../../../../lib/libdmcommon.a(dmvbpar.o)) (code)
ws(istream &) (first referenced in ../../../../lib/libdmcommon.a(dmvbpar.o)) (code)
istream::get_complicated(char &) (first referenced in ../../../../lib/libdmcommon.a(dmvbpar.o)) (code)
hex(ios &) (first referenced in ../../../../lib/libdmcommon.a(dmvbpar.o)) (code)
Iostream_init::~Iostream_init() (first referenced in vbtest.o) (code)
Iostream_init::Iostream_init()%1 (first referenced in vbtest.o) (code)
dec(ios &) (first referenced in ../../../../lib/libdmcommon.a(dmvbpar.o)) (code)
setw(int) (first referenced in ../../../../lib/libdmcommon.a(dmvbpar.o)) (code)
cerr (first referenced in ../../../../lib/libdmcommon.a(dmvbpar.o)) (data)
flush(ostream &) (first referenced in vbtest.o) (code)
istream::operator >>(ios &(*)(ios &)) (first referenced in ../../../../lib/libdmcommon.a(dmvbpar.o)) (code)

Any clues? Which library should I include to get this resolved? I thought aCC -AA would pick up the appropriate libraries to link with. Is that not true? Thanks in advance..
7 REPLIES 7
ranganath ramachandra
Esteemed Contributor

Re: link error when using aCC -AA

i think you have to compile *and* link with -AA, did you do that ?
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

Venkat Chandrasekaran
Occasional Advisor

Re: link error when using aCC -AA

Yes., I compiled all the source files with -AA and also during linking I specify -AA option.
ranganath ramachandra
Esteemed Contributor

Re: link error when using aCC -AA

im sorry, i should have made my question clearer. you should also make sure that the libraries you have specified on the link line (e.g. libdmcommon.a, i guess?) are -AA.

the aCC man page specifically says that code built without -AA will not be binary-compatible with the -AA code or libraries.

if the code in libdmcommon.a was not compiled with -AA but has references to be resolved in libstd or libCsup, i guess you will definitely run into this.
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

Venkat Chandrasekaran
Occasional Advisor

Re: link error when using aCC -AA

Thanks for your reply.
The library libdmcommon.a is built with -AA option. It's a static library. When I try to build a binary that links with libdmcommon.a I get the unresolved externals to the stream references.

Let me rephrase the question: If I compile and link with -AA option, which library should I link with if I use streams?

Thanks!
ranganath ramachandra
Esteemed Contributor

Re: link error when using aCC -AA

i think its libstd_v2.sl, will confirm this. i guess you know that its better to use aCC to link as well (not the linker directly).
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

Venkat Chandrasekaran
Occasional Advisor

Re: link error when using aCC -AA

OK. I figured the problem. I was including the old-style iostream.h instead of the one from std namespace. Once i fixed it, it links fine now..
ranganath ramachandra
Esteemed Contributor

Re: link error when using aCC -AA

i thought that was taken care of by aCC by setting the appropriate include path ?
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo