Operating System - OpenVMS
1751751 Members
3923 Online
108781 Solutions
New Discussion юеВ

Re: C++ link problem undefined symbol std::basic_string

 
Alex Chupahin
Super Advisor

Re: C++ link problem undefined symbol std::basic_string

>>LIBRARIAN only adds global symbols which
>>define something (a function, an object) to
>>the symbol table of the OLB. There should be
>>more than just that "extern" line in this
>>source.

Yes, of course. And please look to the strange thing, that I treat as fantastic behavor.

---------------------------------------------------
$cxx /INCLUDE=([],[-],[--.include]) /DEFINE=(__USE_STD_IOSTREAM)/WARN=DIS=EXTRASEMI/DEB /LIST/SHOW=ALL UFSCOMMON.CC

$ search UFSCOMMON.LIS stringHasWhitespace
I3 46190 SQUIDCEXTERN int stringHasWhitespace(const char *);
E extern "C" int stringHasWhitespace(const char *);
I1 50774 stringHasWhitespace(const char *s)
---------------------------------------------------
How can you see, there is a line 50774, a function definition statement, that generates a global symbol. And this statement is present on every OBJ and LIB shows duplicate symbol error. Ok.
But if I do split preprocessor stage and compilation by hands:
---------------------------------------------------
$cxx /INCLUDE=([],[-],[--.include]) /DEFINE=(__USE_STD_IOSTREAM)/WARN=DIS=EXTRASEMI /DEB /LIST/SHOW=ALL [.UFS]UFSCOMMON
.CC /PREP

$cxx /LIS=ufscommon_ixx.lis ufscommon.ixx

$search ufscommon_ixx.lis stringHasWhitespace

36045 extern "C" int stringHasWhitespace(const char *);

---------------------------------------------------

How can you see, no function definition statement (as it should be).
Any ideas?
Alex Chupahin
Super Advisor

Re: C++ link problem undefined symbol std::basic_string

"[.UFS]UFSCOMMON.CC"
please treat as "UFSCOMMON.CC" - when copy/paste from terminal I do make the mistake.
It is really pain that message cannot be edited after posting. :( :(

Alex Chupahin
Super Advisor

Re: C++ link problem undefined symbol std::basic_string

I start new thread devoted to "Strange behavor of C++" about duplicate names. Please answer there.

But about missing modules (topic of this thread) - I really do not understand what does it mean
"CXXLINK doesn't have access to the CXX_REPORITORY with the demangle information."

I login via SYSTEM account, compiling sources from scratch with usual keys.
Never use /REPOSITORY. I really do not need it. Other products are compiling fine.
Today I'll return to home and try once more on the 8.2 system.

But what about error I got on the 7.3-2 ?
---------------------------------------------------
%LINK-W-NUDFSYMS, 2 undefined symbols:
%LINK-I-UDFSYM, std::basic_ostringstream ,
std::allocator > ::basic_ostringstream(int)
%LINK-I-UDFSYM, std::basic_string , std::al
locator > std::basic_ostringstream , std::al
locator > ::str() const
%LINK-W-USEUNDEF, undefined symbol std::basic_string> , std::allocator > std::basic_ostringstream> , std::allocator > ::str() const referenced
in psect $LINK$ offset %X000014A0
in module DEBUG file SYS$SYSROOT:[SYSMGR.ALEX.GNU.SQUID.SQUID-3_0_STABLE
11.SRC]DEBUG.OBJ;1
%LINK-W-USEUNDEF, undefined symbol std::basic_ostringstreamts , std::allocator > ::basic_ostringstream(int) referenced
in psect $LINK$ offset %X00001640
in module DEBUG file SYS$SYSROOT:[SYSMGR.ALEX.GNU.SQUID.SQUID-3_0_STABLE
11.SRC]DEBUG.OBJ;1
------------------------------------------------------

Alex Chupahin
Super Advisor

Re: C++ link problem undefined symbol std::basic_string

ostringstream description is really present in sstream.h
is it mean that STDC++ library does not contain
such function?
Bug?
x2084
Trusted Contributor

Re: C++ link problem undefined symbol std::basic_string

>>> ostringstream description is really present in sstream.h

Please read the documentation about templates in C++ on OpenVMS/Alpha.

>>> I start new thread devoted to "Strange behavor of C++" about duplicate names.

If you don't mind, I add my comments, here.
Squid comes with "String.cc", the compiler wants/needs its "string.cc", it finds your/Squid's [...SRC]STRING.CC and includes it. That defines stringHasWhiteSpace().

No, defining _USE_INLINE_ 1 or 0 doesn't help. Sorry, I don't have the time to try what the C++ compiler does on ODS5.

Alex Chupahin
Super Advisor

Re: C++ link problem undefined symbol std::basic_string

It seems I should find solution at another place