Compiling and Linking 3GL

How you build your 3GL code depends on the purpose of the code.

  • If you are writing a call-in program (a 3GL application that executes Uniface components using either unifbeg or uecreate), you will compile your sources and then link them into an executable. In cases where this link is not possible, you might want to create a shared library rather than an executable, and use the u3gl program to call into your shared library. See Using the u3gl Program.
  • In all other situations (call-out, user-written connector, etc.) you will compile your sources and then link them into a shared library.

The commands used to compile and link a shared library or executable vary considerably across platforms. See 3GL Compile and Link Commands.

Note: When compiling your 3GL applications, we recommend using the same compiler (or a compliant compiler) as is used to compile the Uniface sources. The compilers used depend on the operating system. For details of the compilers used, see the Platform Availability Matrix.

This is not to say that you cannot compile 3GL with another compiler. You are free to use the compiler of your choice, but you must discover for yourself how to do it, and we cannot guarantee that we can help you when problems arise. This is also the case if you use a language other than C. We have not done tests with other languages, and cannot tell you how to compile and link COBOL, Fortran, Basic, or Pascal code.

When you create a shared library for use with Uniface, we recommend that you put that library in the Uniface lib directory (or on Windows, in the Uniface bin directory), together with all the other Uniface shared libraries, and that you include it in the [USER_3GL] section without a path name and without a suffix. Uniface knows what the suffix is for any given platform, and will add it for you if necessary. The operating system will know where to find the shared library by using the relevant environment variable. In a working Uniface installation, that environment variable is already set correctly, and your shared library will be found easily. If you follow these rules, you do not need to worry about platform-dependent path names or file suffixes, and it will be easier to keep your assignment files portable across multiple platforms.