3GL Compile and Link Commands

Compile and link commands are provided for each platform supported by Uniface.

For using the Uniface 3gl API, Uniface provides include files for the C compiler and libraries in the \uniface\3gl directory. Depending on the API being used, one or more of these files will be required for compiling. All of the libraries can be specified to the linker.

The \uniface\3gl (or equivalent) directory of the installation contains a makefile.inc, These files contain the basic compile and link commands and qualifiers used to build Uniface on that platform. Optionally a symbol defining the platform libraries used in link Uniface is also provided. Please examine these files carefully when considering how to compile and link your own 3GL.

These commands use the minimum set of compile flags and link libraries needed to produce simple call-in and call-out code. Depending on what your code does, you might need additional flags or link libraries.

Note:  We consistently link with all the core Uniface shared libraries (ucall, urtl, ulib, and yrtl) even if they are not necessary. For example, a call-in program typically needs to link only with the ucall library, but there is no harm in specifying all of them; doing so will keep your scripts or makefiles easier to maintain.


If you need to compile more than one C source, you must repeat the crtcmod command for each source (you can compile only one source at a time). Object files in the crtsrvpgm and crtpgm commands must be specified in the format Library/Program.

Before you can create the service program with the crtsrvpgm command, you must create an ‘export file’ that contains a list of functions that will be exported by this service program. By default, crtsrvpgm looks for a member in the file QSRVSRC with the same name as the service program, but you can specify another location by using the SRCFILE parameter. You might have to create the QSRVSRC file with the crtsrcpf command.

For example, suppose you want to create a service program called ALL3GL that exports the function USCALLOUTCALLOUTSIG. You then create the source physical file QSRVSRC in your current library, and, in this file, you create the member ALL3GL containing the following lines:


Note:  There should be no white space between the keyword SYMBOL and the following left parenthesis.

If you are compiling call-out or call-in stub files, be aware of the 10-character limitation on member names. Because Uniface adds the uo_ or ui_ prefix, this limitation can easily be exceeded. Of course, you can always rename these files before compiling them (if you do, remember to change the #include statements in the uo_*.c or uo_*.c files accordingly).