| Date: 6-MAY-1997 08:54:53.51
From: DEC:.REO.REOVTX::WOOD_J "[email protected]"
Subj: Digital ASAP #27550: Linking C object modules on OpenVMS Alpha
To: smtp%"[email protected]"
CC: WOOD_J
Hello Jan,
RE: Linking C object modules on Alpha/OpenVMS
> There seems to be some problems connected with linking C object modules under
> OpenVms 6.1 if these modules were compiled under 6.2, is that so?
Well, as a general rule this has never been supported, although by taking
copies of the v6.1 run-time libraries, etc., it can be possible to do so.
> We are distributing a software package that we've compiled (a combination of
> Pascal, C and Macro code) on an Alpha running OpenVms 6.2. On the target
> machine we link the executables but we get the following error messages when
> doing this:
>
> %LINK-I-UDFSYM DECC$$GA___CTYPET
> %LINK-I-UDFSYM DECC$$GL___CTYPEA
These are DEC C undefined symbols.
The DEC C compiler became aware of which VMS version it is being run on since
the DEC C v5.2 release.
The two symbols above come from the <ctype.h> header-file. From that file:
#if __VMS_VER >= 60200000
# define __ctypet (*decc$$ga___ctypet)
# define __ctypea (decc$$gl___ctypea)
...
Thus if you want to compile on OpenVMS v6.2, but be able to target OpenVMS
v6.1, then you'll need to do the following (-extracted from the DEC C Run-Time
Library manual, section 1.5.4:
++++
1.5.4 Multiple-Version-Support Macro
By default, the header files enable APIs in the DEC C RTL
provided by the version of the operating system on which the
compilation occurs. This is accomplished by the predefined
setting of the __VMS_VER macro, as described in the DEC C
User's Guide for OpenVMS Systems. For example, compiling
on OpenVMS Version 6.2 causes only DEC C RTL APIs from
Version 6.2 and earlier to be made available.
Another example of the use of the __VMS_VER macro is sup-
port for the 64-bit versions of DEC C RTL functions available
with OpenVMS Alpha Version 7.0 and higher. In all header
files, functions that provide 64-bit support are conditionalized
so that they are visible only if __VMS_VER indicates a version of
OpenVMS that is greater than or equal to 7.0
To target an older version of the operating system, do the
following:
1. Define a logical DECC$SHR to point to the old version of
DECC$SHR. The compiler uses a table from DECC$SHR
to perform routine name prefixing.
2. Define __VMS_VER appropriately, either with the /DEFINE
qualifier or with a combination of the #undef and #define
preprocessor directives. With /DEFINE, you may need to
disable the warning regarding redefinition of a predefined
macro.
----
Thus you'll need to obtain a copy of sys$share:DECC$SHR.EXE from an OpenVMS
v6.1 system, call it something like sys$share:decc$shr_61.exe, and do something
like:
$ DEFINE DECC$SHR SYS$SHARE:DECC$SHR_61
you'll need to compile with
$ CC /DEFINE=__VMS_VER=60100000
and maybe add
/WARN=DISABLE=MACROREDEF
to disable warnings about __VMS_VER being redefined.
Hope this helps.
Regards,
John Wood
Digital Equipment Co.
|