The Question is:
I have the task of maintaining the software for a VMS application .EXE written
in C and Macro which I compile, produce .OLBs and link to produce a monolithic
executable .EXE. Some of the C and macro function reference system defined
symbols e.g. CSB$V_MEM
BER, DVS$_DEVCLASS and many more.
I have 'moved' all the macro code and some of the C functions that use these
symbols so that they now reside in a shareable EXE that I link against when I
produce the executable.
I can successfully produce the shareable use /SYSEXE in the linker command: but
when I link against it to produce the executable I get a whole bunch (137 in
total including the two quoted above) undefined symbols. There are references
to these symbols in
the code that is not in the shareable EXE. I can reduce the problem by moving
more code into the shareable but there is one function that would require a
significant redesign if it were to be moved.
I understand from the linker documentaion that
'For Alpha linking, the linker does not process the shareable images that the
shareable image you specify has been linked against. (Shareable images on
Alpha systems still contain GISDs for each shareable image that they have been
linked against, however.
) If your application's build procedure depends on implicit processing of
shareable images, you may need to add these shareable images to your linker
How do I instruct the linker to resolve the symbols ? Is there a combination of
/(NO)SYSEXE, /(NO)SYSSHR, (NO)SYSLIB and/or an explicit specification of a
system library in the options file. If so what is it ?
You can see from my two link commands that follow that I have a fairly complex
build environment that is configured by the DCL symbols. The only one of
interest here is probably SYSEXE_Q that would normally hold "/SYSEXE".
$! build the library to link against because the LINK does not allow wild cards.
$! create the 'default' shared EXE
$ LINK /SHAREABLE=COLI:COLLECTOR_SHR.EXE -
$! switchoff the sysex qualifier while we specify base_image explicitly
$! SYSEXE_Q = ""
$! JWT 1-nov-2001 addition of usv_udt_last_error requires usvl after fill
The Answer is :
Please see the shareable image cookbook (available here in the
Ask The Wizard area) and see the linker manual for details on
the /SHARE and /SYSEXE qualifiers. (/SYSEXE implies the code
is linked against the OpenVMS Alpha kernel.)
The symbols you reference appear to be standard definitions
from OpenVMS include files, and would be resolved using the
default path (SYS$STARLET_C.TLB for public definitions) or
by specifying the SYS$LIB_C.TLB library (for inner-mode and
for internal definitions) on the compilation command.
For details on the C compilation command, please see the C
If this is a User Written System Service (UWSS) or
otherwise operating in executive or kernel mode, you will
want to use /NOSYSLIB to disable access to the user-mode
RTLs including the user-mode C RTL. (Inner-mode code
cannot reference the user-mode RTLs including the user-mode
C RTL and particularly cannot use user-mode RTLs to manage
the image heap and application memory.) Inner-mode C code
should use the kernel-mode C RTL.
CSB$V_MEMBER is present in csbdef in SYS$LIB_C, and can be
referenced by include statement referencing csbdef.h in
the code, and a compilation qualifier referencing the
As has been sited elsewhere, please see the OpenVMS FAQ for
common C coding questions and discussions, please see topic
(1661) for programming errors and considerations (and pointers
to related topics), please see the compiler documentation,
and please see the shareable image cookbook.
For related programming assistance and for information on
available training programs, please consider contacting
your prefered provider and/or HP Services.