fglcomp

The fglcomp tool compiles .4gl source files into .42m p-code modules.

Syntax

fglcomp [options] srcfile[.4gl]
  1. options are described in Table 1.
  2. srcfile .4gl is the program source file.
  3. The .4gl extension is optional.

Options

Table 1. fglcomp options
Option Description
-V or --version Display version information for the tool.
-h or --help Display options for the tool. Short help.
-i { mbcs } Display information. -i mbcs displays information about multibyte character set settings.
-S Dump Static SQL statements found in the source to stdout.
-m Extract %"string" localized strings from source to stdout.
-M Write error messages to standard output instead of creating a .err error file.
-W what Display warning messages. For a complete description, see Arguments for the -W option.
-E Preprocess only. See The preprocessor for more details.
--timestamp Add compilation timestamp to build information in 42m header.
-p option

Preprocessing control, where option can be one of:

  • nopp: Disable preprocessing.
  • noli: No line number information (only with -E option).
  • fglpp: Use # syntax instead of & syntax.
-G Produce .c and .h globals interface files for C Extensions.
-I path Provides a path to search for include files. See The preprocessor for more details.
-D ident Defines the macro 'ident' with the value 1. See The preprocessor for more details.
--build-doc Generate source documentation.
--build-rdd Generate the .rdd data definition during compilation.
--verbose Print detailed compilation information.
--implicit=type Specify whether or not to compile imported modules, where type can be one of:
  • none: Disable any implicit compilation.
  • 42m: Compileimported modules if needed (the default).
-r or --resolve-calls

Throw an error on references to undeclared functions. Each external function must be made ​​known to the compiler by IMPORT FGL. When using this option, the linking phase is no longer needed; a source (4gl ) file compiled with this option must not be linked. See IMPORT FGL module. The compilation will fail if it detects circular dependencies.

--java-option=option

Passes Java™ runtime options when initializing the JNI interface.

See Java Interface for more details.

Usage

The fglcomp tool compiles a .4gl into a .42m p-code module:
fglcomp customers.4gl

If a compilation error occurs, the compiler generates an error file with an .err extension. The error file contains the original source code with error messages. Use the option -M to display the error messages to standard error instead of producing the .err file.

Arguments for the -W option

The -W option can be used to check for wrong language usage, that must be supported for backward compatibility. When used, this option helps to write better source code.

The argument following -W option can be one of return, unused, stdsql, print, error or all.

The -W option also supports the negative form of arguments by using the no- prefix as in: no-return, no-unused, no-stdsql. You might need to use these negative form in order to disable some warning when using the -W all option:
fglcomp -Wall -Wno-stdsql customers.4gl

Switches will be enabled/disabled in the order of appearance in the command line.