Compiling Your Programs

The ACUCOBOL-GT compiler is most easily used via AcuBench. However, it is also possible to compile from the command prompt or the Windows Start menu, 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 did not add the location of the compiler to the PATH environment variable, or you have not rebooted since installing the software.

You can check the current definition of PATH by typing path and pressing Enter at the command prompt. The default path is C:\Program Files\Micro Focus\extend x.x.x\AcuGT\bin (or c:\Program Files (x86)\... for 64-bit installations). If you do not update PATH with this entry, you must type the full path and program name to the compiler each time you compile; alternatively, you can 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. Refer to ACUCOBOL-GT User's Guide > Compiler and Runtime > Using the Compiler for a complete list of compile options. 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