Operating System - OpenVMS
1752796 Members
5607 Online
108789 Solutions
New Discussion юеВ

Re: Problem CXXLINKing builtins

 
Joe Swatosh
New Member

Problem CXXLINKing builtins

Attempting to link simple executables using the Standard Library causes undefined symbol errors. For example

$ run show_macros
__CRTL_VER 70210022
__VMS_VER 70210022
__VMS_VERSION V7.2-1
__DECCXX_VER 60390020
$ cc/version
DEC C V5.6-003 on OpenVMS Alpha V7.2-1
$ cxx/version
Compaq C++ V6.3-020 for OpenVMS Alpha V7.2-1
$ cxxlink/version
Compaq C++ CXXLINK V6.3-020
$ write sys$output f$getsyi ( "VERSION" )
V7.2-1
$ type play.cxx

#include
#include

int main ()
{
std::string a;
return EXIT_SUCCESS;
}
$ mms/macro=(link=cxxlink)/from play.exe
CXX /NOLIST/OBJECT=PLAY.OBJ PLAY.CXX
CXXLINK /TRACE/NOMAP/EXEC=PLAY.EXE PLAY.OBJ
%LINK-W-NUDFSYMS, 3 undefined symbols:
%LINK-I-UDFSYM, int __ATOMIC_DECREMENT_LONG(volatile void *)
%LINK-I-UDFSYM, int __ATOMIC_INCREMENT_LONG(volatile void *)
%LINK-I-UDFSYM, void __MB()
%LINK-W-USEUNDEF, undefined symbol void __MB() referenced in psect $LINK$ offset %X00000470 in module PLAY file DISK$x:[PLAY]PLAY.OBJ;44
%LINK-W-USEUNDEF, undefined symbol int __ATOMIC_DECREMENT_LONG(volatile void *) referenced in psect $LINK$ offset %X00000490 in module PLAY file DISK$x:[PLAY]PLAY.OBJ;44
%MMS-F-ABORT, For target PLAY.EXE, CLI returned abort status: %X10648268.

I've tried with #
include with the same result. After reading the docs, I am surprised that the compiler is trying to call functions with those names at all. Unfortunately, upgrading isn't really an option due to 3rd party library dependencies.

Any answers, hints or otherwise greatly appreciated.

Thanks, Joe
2 REPLIES 2
Steven Schweda
Honored Contributor

Re: Problem CXXLINKing builtins

For the record, it seems to work here.

alp $ mms/macro=(link=cxxlink)/from play.exe

CXX /NOLIST/OBJECT=PLAY.OBJ PLAY.CXX
CXXLINK /TRACE/NOMAP/EXEC=PLAY.EXE PLAY.OBJ
alp $ run PLAY.EXE


alp $ cc /version
HP C V7.1-015 on OpenVMS Alpha V7.3-2

alp $ cxx /version
HP C++ V7.1-015 for OpenVMS Alpha V7.3-2

alp $ cxxlink /version
hp C++ CXXLINK V7.1-015

> [...] upgrading isn't really an option [...]

Even the compilers?
Joe Swatosh
New Member

Re: Problem CXXLINKing builtins

>For the record, it seems to work here.
>[...]
>
>> [...] upgrading isn't really an option [...]
>
>Even the compilers?

Thanks for the info, sadly compilers are unlikely to be updated. I tried on a different system with

"DEC C++ V6.0-001 on OpenVMS Alpha V7.2-1"

(otherwise identical) and it worked fine. I'm suspecting an installation issue?

Ta, Joe