Compiling Your Programs

The ACUCOBOL-GT compiler is most easily used via AcuBench. However, it is also possible to compile from the command prompt, to use the Run dialog to compile, to establish an association between your source files and the compiler executable, or to set up one or more icons to compile individual files. For information regarding creating file associations and setting up icons, see your Windows documentation.

When you compile, if the system returns "Bad command or file name," you didn't add the location of the compiler to your PATH, or you haven't rebooted since installing the software. You can check the current definition of PATH by typing path and pressing the Enter key at the command prompt. The path is C:\Program Files\Micro Focus\Acucbl9xx\AcuGT\bin\ccbl32.exe, by default. You may choose to type the full path and program name each time you compile or create a .bat file.

Once you have verified that the compiler is in your PATH (or you have decided that you will specify the full path every time you compile), you are ready to compile your programs. A complete list of compile options is located in the ACUCOBOL-GT User's Guide > Compiler and Runtime > Using the Compiler. You can also display a complete list of options by running the compiler command:

ccbl32  -help  

One commonly used option is "-o". This option is used to specify the name of the output object file. Note that ACUCOBOL-GT uses the naming convention ".acu" to indicate an ACUCOBOL-GT object file. If "-o" is not used, the compiler will name the file "source-name.acu". If your source includes COPY files, you can copy the COPY files to your current working directory, specify their location with the "-Sp" option followed by the complete path of one or more directories, or set the COPYPATH environment variable. A typical compilation command might look like:

ccbl32 -Sp c:\work\lib -o sample.cbx sample.cbl