[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::c_plus_plus

Title:C++
Notice:Read 1.* and use keywords (e.g. SHOW KEY/FULL KIT_CXX_VAX_VMS)
Moderator:DECCXX::AMARTIN
Created:Fri Nov 06 1987
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:3604
Total number of notes:18242

3576.0. "Accvio, virtual tables, in shareable image??" by KERNEL::PULLEY (Come! while living waters flow) Mon May 19 1997 06:44

Hi Folks,

This might not be a C++ thing, but I thought I'd start here.
I've a customer with the following scenario.
He has two VAXes:  one VMs v5.5, C++ v5.5;  two VMS v6.2, C++ v5.4.
If he compiles, links, runs on VAX two, it's fine.
If he compiles on one, links and runs on two, that's works.
If he compiles & links & runs on one it fails at run-time with:-
system-f-operand, ...

He reckons it's to do with virtual tables.
When linked on VAX one, virtual tables didn't seem to be initialised correctly.
On VAX two they seem ok.
(He checked that out, I wasn't quite sure how to).

I've tryed the same with some example code here, but I'm using C++ v5.5 on
both v5.5-2 & v6.2.
The program involves a shareable image, and the accvio is part way through
that.
If I build an object library, and link against that instead of making it a
shareable image, it is successful on VMS v5.5-2.

Where should we look next?
Is this simply, most likely a problem in the code, or should I check out
other differences in the systems like the version of DECC$shr?

Thanks,
Steve.
T.RTitleUserPersonal
Name
DateLines
3576.1more files...HNDYMN::MCCARTHYA Quinn Martin ProductionMon May 19 1997 08:344
The command and files (linker options file) that are used to create the 
shareable image would help.

bjm
3576.2html example locationHNDYMN::MCCARTHYA Quinn Martin ProductionMon May 19 1997 09:5410
Also, please check out
http://hndymn.zko.dec.com/~cxxrtl/ft_docs/vms_shareable.html

I just put code examples and a yet-to-be reviewed version of how 
to create shareable images from C++ source code in that directory.

However, the area of static initialization is not covered in detail.  It
covers details on how to determine what names to export.

bjm
3576.3KERNEL::PULLEYCome! while living waters flowTue May 20 1997 11:1033
I took a look at the html page--what he's got doesn't look very similar--
but it does seem like he's trying to export parts of the class.
There's no Macro code anywhere in his stuff.
I don't understand why the same build procedure appears to work for the
later version of VMS.

Here's part of the command file used to build the .exes.
$ loc = f$environment ("Procedure")
$ dev = f$parse (loc,,, "Device")
$ dir = f$parse (loc,,, "Directory")
$ CPP:== CXX/NOOPT/include=[]/nest=none
$ ass 'dev''dir'accdst30.exe accdst30_shr
$ CPP strmmain.cpp /noprefix
$ CPP allocate.cpp
$ CPP strutils.cpp
$ CPP accdstrm.cpp
.
.
.
$ CPP stricmp.c /def="__vms__"
$ lib/create/obj accdst30.olb *.obj /log
$ link/share accdst30.opt/opt
$ cpp test.cpp
$ link test.opt/opt

And this is accdst30.opt
accdstrm.obj
accdst30.olb/lib
Universal=CXX$CRAT14ACCRDSTRAMCXPK1GF54BF
Universal=CXX$DSTRY14ACCRDSTRAMCXP0ON6PFF
Universal=VERSION__14ACCORDSTREAM_CXV
GSMATCH=LEQUAL,30,1
    
3576.4is this an init problem?HNDYMN::MCCARTHYA Quinn Martin ProductionTue May 20 1997 12:069
I think the html document mentions that using universal to export from a
shareable image is dangerous and usually means that all users of the 
shareable image must relink every time a new shareable image is created.

Assuming this is an initialization problem, have they isolated all 
static variables that are required to be initialized into one module and
when linking, list that object first?

bjm