Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

CXX thinks CRTL version is older than CC does

SOLVED
Go to solution
Travis Craig
Frequent Advisor

CXX thinks CRTL version is older than CC does

I have an OpenVMS V7.3-1 system on which CC thinks __CRTL_VER is
70312000
and CXX thinks it is
70310022

I'm trying to use the snprintf() and vsnprintf() functions and stdio.h makes them visible only if __CRTL_VER is >=70312000.

So, they are visible to CC, but not CXX, on the same machine with the same C run-time library. Has anybody encountered this and do you know how to fix it? I tried the VMS731_ACRTL_V0400 patch, but that made no difference. Is there a compiler patch? I haven't run into those. I have:

CC V6.5-001
CXX V6.5-004

My uses of the function are, of course, in some C++ modules.

--Travis Craig
My head is cold.
8 REPLIES
Karl Rohwedder
Honored Contributor

Re: CXX thinks CRTL version is older than CC does

Our CXX compiler has the version:

Compaq C++ V6.5-039 for OpenVMS Alpha V8.2

regards Kalle
Ian Miller.
Honored Contributor

Re: CXX thinks CRTL version is older than CC does

Just a thought but - Did you install C before or after C++ and have you installed any CRTL patches?
____________________
Purely Personal Opinion
Wim Van den Wyngaert
Honored Contributor

Re: CXX thinks CRTL version is older than CC does

Just a guess : show log *crtl*.
2 logicals to different files ?

WIm
Wim
Travis Craig
Frequent Advisor

Re: CXX thinks CRTL version is older than CC does

Thanks, everybody, for the replies.

It looks like CC was installed (moments) after CXX. Does order matter?

When you say "CRTL patches," Ian, do you mean the ones like VMS731_ACRTL_V0400 (which I installed), or some other ones for the compilers themselves? I haven't been able to find any patches for compilers mentioned online. Maybe it's time to go down and look at the layered product disks.

I see no suspicious looking logical names, none that look related to compiler or library versions.

--Travis
My head is cold.
Ian Miller.
Honored Contributor

Re: CXX thinks CRTL version is older than CC does

Yes CRTL patches like that one.
I don't know how the compilers determines the CRTL version.
____________________
Purely Personal Opinion
Kris Clippeleyr
Honored Contributor

Re: CXX thinks CRTL version is older than CC does

Travis,

I got the same phenomenon on our development cluster (VMS 7.3-1, CC V6.5-001, CXX V6.5-004).
However, I've included a small program that not only uses __CRTL_VER but also DECC$$GL___CRTL_VER. Please compile it with both CC and CXX, and mark the difference.
Here the version compiled with CC, prints the same value for __CRTL_VER and DECC$$GL___CRTL_VER. If compiled with CXX, the values differ. It seems that the global longword DECC$$GL___CRTL_VER is defined in SYS$SHARE:DECC$CRTL.EXE, and for CC has the same value as __CRTL_VER. Unfortunately this is not the case for CXX.

Regards,
Kris (aka Qkcl)
I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
Kris Clippeleyr
Honored Contributor
Solution

Re: CXX thinks CRTL version is older than CC does

Hi Travis,
Back again. Please have a look at the file SYS$SHARE:DECC$CRTL.README. It says somewhere

The default value assigned to the predefined macro __CRTL_VER differs between Compaq C and Compaq C++. Compaq C will default __CRTL_VER to the value found within the DECC$CRTL.EXE name mapping table. Compaq C++ does not examine this value with the shareable image. Compaq C++ defaults __CRTL_VER to the same value as __VMS_VER.


So, I think you better compile your C++ sources with /DEFINE=__CRTL_VER=70312000 (the value found in DECC$CRTL.EXE).

Regards,
Kris (aka Qkcl)

I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
Travis Craig
Frequent Advisor

Re: CXX thinks CRTL version is older than CC does

Thanks, everybody. That last one looks like a definitive answer to me. Back to fighting with Windows and UNIX now. :-)

--Travis
My head is cold.