Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)

c89 file.c -lc -Wcall_shared -WBstatic -l archive -WBdynamic
-l native
ld (if the target platform is TNS/R) or eld (if the target platform is TNS/E) performs dynamic
linking by searching first for the file libc.so and then libc.a. ld or eld then performs
static linking by searching for the file libarchive.a. ld or eld then performs dynamic
linking by searching first for the file libnative.so and then libnative.a.
The following command compiles the source file mydll.c and links the PIC linkfile to create
a DLL.
c89 -Wshared -o mydll mydll.c
ld or eld performs the linking and creates a DLL in a file named mydll.
The following example compiles file.c with SQL/MP support enabled with the native C
compiler.
c89 -Wsql=release2,sqlmap -c file.c
An SQL map is included in the listing, and the Release 2 version of SQL/MP features is used.
The SQL/MP preprocessor is run; the SQL/MP compiler is not run. Note that there is no blank
space after the comma (,) and no space before or after the equal sign. Because the -c flag
is used, no binding is performed.
The following example compiles file.c with SQL/MX support enabled with the native C
compiler, and creates file.o if there are no errors in compilation:
c99 -Wsqlmx=listing -c file.c
The SQL/MX preprocessor is run; the SQL/MX compiler is not run. An SQL error log named
file.eL is created if necessary because listing is specified, and an SQL module definition
file named file.m is created. Note that there is no blank space after the comma (,). Because
the -c flag is used, no binding is performed.
The following example uses the TNS C compiler. The source file test.c is compiled into
test.o. The warnings of types 96, 93, and 168 are suppressed:
c89 -c -Wccom="nowarn(96,93,168)" test.c
Editing OSS Files
The following subsections introduce the vi editor, which is available in the OSS environment, and
the emacs editor, which can be obtained for the OSS environment.
Editing OSS Files Using vi
For tasks such as writing memos and modifying C or C++ programs, editing text files is one of the
most common uses of any computer system. The vi text editor is particularly well-suited for the
day-to-day tasks of most computer users. Using vi, you can quickly and easily open a file, edit it,
and save the results. The vi editor operates basically the same way on all UNIX based systems,
so if you have used vi on a UNIX system in the past, you should feel at home using it in the OSS
environment.
While vi does not have some of the features of proprietary text editors and word processors, it
is a full-featured text editor with the following major features:
Fast processing, especially on start-up and global operations
Full-screen editing and scrolling capability (unlike the line editor ed, on which vi is based)
Complex editing features such as global substitutions
For more information about the vi utility in the OSS environment refer to the vi(1) online reference
page, the Open System Services Shell and Utilities Reference Manual, or the Open System Services
User’s Guide.
Working on the NonStop System 43