HPlogo ALLBASE/SQL Pascal Application Programming Guide: HP 9000 Computer Systems > Chapter 1 Getting Started with ALLBASE/SQL Pascal Programming

Compiling and Linking the Program

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Figure 1-3 “Compile-Time and Linking-Time Events” summarizes the steps in creating an executable ALLBASE/SQL Pascal program from the files created by the Pascal preprocessor.

Figure 1-3 Compile-Time and Linking-Time Events

[Compile-Time and Linking-Time Events]

You submit to the Pascal compiler a modified source code file and related include files created by the preprocessor. The compiler then generates an object code file. To convert one or more object code files into an executable program, you link them by invoking the HP-UX Linker. This step creates an executable program file.

In the following example, an executable program named someprog.r is created after a module named somemod is stored by the Pascal preprocessor in a DBEnvironment named somedbe:

   login: pgmr1



   $ psqlpas somedbe -m somemod -i mysource.sql -p mysource.p -d

         .

         .

   $ pc mysource.p -lsql -lportnls -o someprog.r
NOTE: 300/400 For Series 300 and 400 systems, use the following command, to create the executable module:
   $ pc mysource.p -lsql -lheap2 -lpc -lportnls -o someprog.r

Refer to "Full Preprocessing Mode" in the chapter, "Using the ALLBASE/SQL Pascal Preprocessor" for more information on the psqlpas command.

The -lsql option tells the compiler to link in the runtime library /usr/lib/libsql.a. The -lportnls option tells the compiler to link in the native language routines. The -o option tells the compiler to create the executable output file someprog.r.