- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- C++ link problem undefined symbol std::basic_stri...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2009 06:30 AM
тАО02-03-2009 06:30 AM
C++ link problem undefined symbol std::basic_string
In linking C++ I see undefined symbols.
Please help?
CXXL []cf_gen.obj,debug.obj,time.obj,globals.obj,squid/LIB,auth/LIB,[-.LIB]miscu
til/LIB
%LINK-W-MULDEF, symbol DECC$TOLOWER multiply defined
in module DECC$SHR file SYS$COMMON:[SYSLIB]DECC$SHR.EXE;1
%LINK-W-NUDFSYMS, 2 undefined symbols:
%LINK-I-UDFSYM, std::basic_ostringstream
std::allocator
%LINK-I-UDFSYM, std::basic_string
locator
locator
%LINK-W-USEUNDEF, undefined symbol std::basic_string
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_ostringstream
in psect $LINK$ offset %X00001640
in module DEBUG file SYS$SYSROOT:[SYSMGR.ALEX.GNU.SQUID.SQUID-3_0_STABLE
11.SRC]DEBUG.OBJ;1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2009 06:56 AM
тАО02-03-2009 06:56 AM
Re: C++ link problem undefined symbol std::basic_string
compiling with /DEF=(__USE_STD_IOSTREAM)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2009 07:10 AM
тАО02-03-2009 07:10 AM
Re: C++ link problem undefined symbol std::basic_string
If your source code contains its own
tolower() function, get rid of it. (Bad
"config.h" choices?)
> %LINK-I-UDFSYM, std::basic_ostringstream [...]
I know almost nothing about C++, but I'd
guess that you're calling basic_ostringstream
with argument types which don't match the
standard ones.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2009 07:26 AM
тАО02-03-2009 07:26 AM
Re: C++ link problem undefined symbol std::basic_string
And yes, get rid of the MULDEF, your copy of tolower used in the image, right now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-04-2009 11:50 AM
тАО02-04-2009 11:50 AM
Re: C++ link problem undefined symbol std::basic_string
Things are more strange. I do not understand this things any more.
Previously I tried on 7.3-2. CXX is V7.3-009
Now I've tried the same sources with the same DESCRIP.MMS on the 8.2 with the same version of the compiler - another strange:
%LINK-I-UDFSYM, CURRENTDEBUG__5DEBUG
%LINK-I-UDFSYM, CXXL$CTQ13STD62BSCSTRNGC1626C2E
%LINK-W-USEUNDEF, undefined symbol CURRENTDEBUG__5DEBUG referenced
in psect $LINK$ offset %X00001450
in module DEBUG file SYS$SYSROOT:[SYSMGR.ALEX.GNU.SQUID.SQUID-3_0_STABLE11.SRC]DEBUG.OBJ;1
%LINK-W-USEUNDEF, undefined symbol CXXL$CTQ13STD62BSCSTRNGC1626C2E referenced
in psect $LINK$ offset %X00001D40
in module DEBUG file SYS$SYSROOT:[SYSMGR.ALEX.GNU.SQUID.SQUID-3_0_STABLE11.SRC]DEBUG.OBJ;1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-04-2009 12:11 PM
тАО02-04-2009 12:11 PM
Re: C++ link problem undefined symbol std::basic_string
so called *the best*
It seems tonn bugs in the HP C++ compiler ??
I'm compiling source files, as I do it many thousend times:
cxx /INCLUDE=([],[-],[-.include]) /DEFINE=(HAVE_CONFIG_H,__USE_STD_IOSTREAM) /OPTIMIZE=(INLINE=SPEED) /WARN
=(DIS=EXTRASEMI) AUTHSCHEME.CC
cxx /INCLUDE=([],[-],[-.include]) /DEFINE=(HAVE_CONFIG_H,__USE_STD_IOSTREAM) /OPTIMIZE=(INLINE=SPEED) /WARN
=(DIS=EXTRASEMI)AUTHUSER.CC
LIB/CREA AUTH AUTHSCHEME.OBJ,AUTHUSER.OBJ
I just got:
%LIBRAR-E-DUPGLOBAL, global symbol STRINGHASWHITESPACE from file SYS$SYSROOT:[SYSMGR.ALEX.GNU.SQUID.SQUID-3_0_STABLE11.SRC]AUTHSCHEM
E.OBJ;1 already in library SYS$SYSROOT:[SYSMGR.ALEX.GNU.SQUID.SQUID-3_0_STABLE11.SRC]auth.olb;1
%LIBRAR-E-DUPGLOBAL, global symbol STRINGHASWHITESPACE from file SYS$SYSROOT:[SYSMGR.ALEX.GNU.SQUID.SQUID-3_0_STABLE11.SRC]AUTHUSER.
OBJ;1 already in library SYS$SYSROOT:[SYSMGR.ALEX.GNU.SQUID.SQUID-3_0_STABLE11.SRC]auth.olb;1
The STRINGHASWHITESPACE is defined in header
as SQUIDCEXTERN int stringHasWhitespace(const char *);
SQUIDCEXTERN is defined
#ifdef __cplusplus
#define SQUIDCEXTERN extern "C"
#endif
And, I wish to say, there are lot of functions (about 30 or 40) defined exactly as stringHasWhitespace before and later that string. But troubles are only with stringHasWhitespace()
Please, I need your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-04-2009 12:15 PM
тАО02-04-2009 12:15 PM
Re: C++ link problem undefined symbol std::basic_string
This problem solves very very strange:
If I preprocess first the file
like
CXX ...MY FLAGS... /PREP file.cc
CXX file.ixx
I avoid the error with dublicate name.
Is it bug in CXX ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2009 01:43 AM
тАО02-05-2009 01:43 AM
Re: C++ link problem undefined symbol std::basic_string
%LINK-I-UDFSYM, CXXL$CTQ13STD62BSCSTRNGC1626C2E
This is the real thing, the Alpha linker, but you are linking C++. On Alpha you should always use CXXLINK if there are C++ modules included in the link operation.
I can't find CXXL$CTQ13STD62BSCSTRNGC1626C2E in the CXX OLBs on my system. I have no idea where it comes from and how to demangle it. If you use CXXLINK, the UDFSYM message will be demangled. That should give you a hint.
>>> LIB/CREA AUTH AUTHSCHEME.OBJ,AUTHUSER.OBJ
Looks odd to me. If there is a duplicate symbol in both object modules, you should see only one error message, here from AUTHUSER. /CREA creates a fresh library. But even if you replace both modules and there is a duplicate, you should only see a message from the last module. It looks like you already have a different module defining that symbol in the OLB. But that doesn't match your /CREA.
>>> SYS$SYSROOT:[SYSMGR.ALEX.GNU....
SYS$SYSROOT is a search list, I don't think you need it, I don't think it's the cause of your problem, but it may be confusing and I would avoid it, here.
>>> #ifdef __cplusplus
#define SQUIDCEXTERN extern "C"
#endif
This doesn't say anything about where the definition of the function is. You can always use "extern int foo();" and later on in the same source an "int foo(){return 0;}".
It looks like something is wrong with the macro definitions and/or the conditional compilation, as you indicate in the next reply. I would rather use /list/show=all to determine where the stringHasWhitespace() is defined.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2009 07:12 AM
тАО02-05-2009 07:12 AM
Re: C++ link problem undefined symbol std::basic_string
>> This is the real thing, the Alpha linker,
>>but you are linking C++. On Alpha you
>>should always use CXXLINK if there are C++
>>modules included in the link operation.
I always use CXXLINK with any C++ programs/modules, not LINK.
What about undefined symbols? Please what do you think about?
>> I would rather use /list/show=all to
>>determine where the stringHasWhitespace()
>>is defined. "
Ok,
here is a fragment from LIS file:
-----------------------------------------------
I3 46192 SQUIDCEXTERN void kb_incr(kb_t *, size_t);
E extern "C" void kb_incr(kb_t *, size_t);
I3 46193 SQUIDCEXTERN int stringHasWhitespace(const char *);
E extern "C" int stringHasWhitespace(const char *);
I3 46194 SQUIDCEXTERN int stringHasCntl(const char *);
E extern "C" int stringHasCntl(const char *);
---------------------------------------------
How can you see, "SQUIDCEXTERN" is become
"extern "C""
Please note, Neither global stringHasCntl, no global kb_incr leads to such error.
stringHasWhitespace() only is.
And one more important thing.
No stringHasWhitespace() is using in that c++ sources either.
stringHasWhitespace() is only in a header...
Problems still here, what do you think about?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2009 10:38 AM
тАО02-05-2009 10:38 AM
Re: C++ link problem undefined symbol std::basic_string
If you get the real linker messages with mangled names, then you either use LINK or CXXLINK doesn't have access to the CXX_REPORITORY with the demangle information. The latter may be the case if the object module wasn't compiled on your system. This application came as source code, right?, so I assume you compiled everything.
>>> What about undefined symbols? Please what do you think about?
CURRENTDEBUG__5DEBUG looks like a user defined function like currentDebug which expects a class/struct named "debug", or so. An application object module with its definition is missing in the link operation. Or, the source lines with the definition were not compiled.
CXXL$CTQ13STD62BSCSTRNGC1626C2E looks like a C++ name, which should be in one of the supplied C++ shareable images or OLBs. As I said, I can't find it on my system, but I have different compilers. On the other hand, CXXLINK should include these libraries for you.
>>> here is a fragment from LIS file:
The fragment shows the include file and the expansion of the macro SQUIDCEXTERN. Did you check the whole .LIS if and where the name "stringHasWhitespace" shows?
For only a 'extern "C" int stringHasWhitespace(const char *);' the C++ compiler will not define the global symbol STRINGHASWHITESPACE. 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.
It's unlikely that this is a C++ compiler bug.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2009 10:50 PM
тАО02-05-2009 10:50 PM
Re: C++ link problem undefined symbol std::basic_string
>>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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2009 11:00 PM
тАО02-05-2009 11:00 PM
Re: C++ link problem undefined symbol std::basic_string
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. :( :(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2009 04:13 AM
тАО02-06-2009 04:13 AM
Re: C++ link problem undefined symbol std::basic_string
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
%LINK-I-UDFSYM, std::basic_string
locator
locator
%LINK-W-USEUNDEF, undefined symbol std::basic_string
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_ostringstream
in psect $LINK$ offset %X00001640
in module DEBUG file SYS$SYSROOT:[SYSMGR.ALEX.GNU.SQUID.SQUID-3_0_STABLE
11.SRC]DEBUG.OBJ;1
------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2009 04:53 AM
тАО02-06-2009 04:53 AM
Re: C++ link problem undefined symbol std::basic_string
is it mean that STDC++ library does not contain
such function?
Bug?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2009 06:17 AM
тАО02-06-2009 06:17 AM
Re: C++ link problem undefined symbol std::basic_string
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2009 05:01 AM
тАО02-07-2009 05:01 AM