CRE Programmer's Guide
Common Run-Time Environment (CRE) Programmer’s Guide—528146-004
4-1
4
Compiling and Linking Programs for 
the Native CRE
Read this section for information about compiling and linking native programs that run 
in the Common Run-Time Environment (CRE). This section describes both the 
Guardian and OSS environments, but focuses on the Guardian environment. Refer to 
the 
Open System Services Shell and Utilities Reference Manual and the 
C/C++ Programmer’s Guide for information about compiling and linking in the OSS 
environment.
See Section 3, Compiling and Binding Programs for the TNS CRE
, for details on 
compiling and binding TNS and accelerated programs.
Before you can use the information in this section, you must convert your existing 
C-series programs to meet the requirements of the D-series operating system. Refer to 
the 
Guardian Application Conversion Guide for detailed conversion information.
Native programs cannot use all of the CRE services available to TNS and accelerated 
programs. Refer to the 
TNS/R Native Application Migration Guide or the appropriate 
programming language manual for the changes required to convert TNS programs to 
native programs.
Using the Environment Variable for C and C++ 
Modules
By default, the native C and C++ compilers generate modules that run in the CRE. The 
env pragma (or -Wenv flag to the c89 utility) determines the availability of run-time 
library and language features in a module. The four 
env pragmas are: 
•
env common
•
env library
•
env embedded
•
env libspace
The default is env common. For each env pragma, the compilers generate different 
code and impose different restrictions on which run-time library and language features 
can be used. 
Table 4-1
 on page 4-2 shows the features available with each env pragma.
Note. TNS object code, accelerated object code, and native object code cannot be mixed in 
one program file. Thus, you cannot mix modules compiled by a TNS compiler or processed by 
the Accelerator with modules compiled by a TNS/R or TNS/E native compiler.










