Freestanding applications need to be linked with specific alternate initialization routines.
INCLUDE SYSLIB(EDCXSTRT)
ENTRY EDCXSTRT
INCLUDE SYSIN
When building freestanding applications under MVS, CEE.SCEESPC must be included in the link-edit SYSLIB concatenation. Also, if C library functions are needed, CEE.SCEESPC must precede CEE.SCEELKED.
The routines to support this function (EDCXSTRT and EDCXSTRL) are CEESTART replacements in your module. You must specify NOSTART compiler option when compiling the file that contains the main function. Therefore, the appropriate EDCXSTRn routine must be explicitly included at link-edit.
#include <stdio.h>
main() {
puts("Hello, World");
return 3999;
}
INCLUDE SYSLIB(EDCXSTRL)
INCLUDE OBJECT
ENTRY EDCXSTRL
//* Appropriate JOB card
//*-----------------------------------------------------------------
//**************************************************
//*** COMPILE AND LINK USING EDCXSTRL AS ENTRY POINT
//**************************************************
//C106001 EXEC EDCCL,
// INFILE='ANDREW.SPC.SOURCE(C106000)',
// OUTFILE='ANDREW.SPC.LOAD(C106000),DISP=SHR',
// CPARM='OPT(2),NOSEQ,NOMAR,NOSTART',
// LPARM='RMODE=ANY,AMODE=31'
//LKED.SYSLIB DD DSN=CEE.SCEESPC,DISP=SHR
// DD DSN=CEE.SCEELKED,DISP=SHR
//LKED.SYSIN DD *
INCLUDE SYSLIB(EDCXSTRL)
ENTRY EDCXSTRL
/*