Packages for Windows
You have a number of items on the menu to choose from. The first two are self-extracting executables that provide standalone support for GnuCOBOL and the debugger without requiring the MSYS2 environment. The other two provide support for the 32-bit and 64-bit versions of the MSYS2 Linux-like environment for Windows.
Standalone GnuCOBOL plus CBL-GDB for Windows.
- 32-bit standalone installation (by default in C:/gnucobol32)
- 64-bit standalone installation (by default in C:/gnucobol64)
The self-extracting executables each create a standalone directory that includes the GnuCOBOL compiler and the CBL-GDB debugging extensions.
Note, dated 2021-03-12: After our development machine was upgraded to Windows 10 20H2, the self-extracting executables stopped functioning.
It turns out that the upgrade exposed not one, but two new security “features”.
First, when launching the self-extracting executable, the decompression would take place and then a message box opened up announcing “Access is denied”. This was eventually tracked down to Kaspersky Anti-Virus. Even though the directory with the file was white-listed, the decompression was apparently going to some other temporary directory that Kaspersky was watching…and it wasn’t allowing the program to execute.
Second, after Kaspersky was disabled, the decompression would take place and then the SETUP application could be seen opening and closing in a flash. The application includes code that gives the user the choice of having registry entries changed, and so the system is insisting that the application have elevated privileges.
So, after disabling your anti-virus, you need to right-click the self-extractor and select “Run as administrator”.
This is technically known as a pain in the neck.
Eventually we’ll come up with installation packages that Windows will allow to run.
Meanwhile, users with 7-zip installed on their computers can right-click the .exe and use 7-zip to extract the gnucobol32 or gnucobol64 folder. Alternatively, you can download the gnucobol32 or gnucobol64 folders as .ZIP files from the following links.
Once you have extracted either gnucobol32 or gnucobol64 – if you aren’t sure which is right for you, select gnucobol32 – you make the compiler usable by issuing, at a Wendows command prompt, the instruction
c:\gnucobol32\bin\cobenv.cmd. That sets up the environment so that the GnuCOBOL compiler and the cbl-gdb debugger can be used.
Choosing a version
On a 32-bit Windows installation, you have no choice: Only the 32-bit version will work on your system.
The two can coexist on a 64-bit Windows installation. You can install either, or both. The only real selection criterion about which to use has to do with what libraries you might want to access from your COBOL code, and whether they have 32-bit or 64-bit interfaces. If that doesn’t mean much to you, then just install the one that matches your system; these days, that’s most likely the 64-bit version.
When launched, the self-extractor will ask you where you want the executables installed. It will offer to modify your environment for ease of use of the package. If you turn down that offer, it will tell you the location of the batch file you’ll need to run to set up the environment on a per-session basis.
Note that if you install both packages, you can set up permanent environment variables for at most one of them.
The GnuCOBOL User’s Guide explains the normal use of
cobc and the libraries.
The COBOLworx walkthrough of the debugging package explains the use of the CBL-GDB debugging extensions.
GnuCOBOL plus CBL-GDB for the MSYS2 environment in Windows.
The other two items you can choose from are installation packages for the MSYS2 environment:
Those two packages install GnuCOBOL and the CBL-GDB extensions into either /mingw32 or /mingw64 in the MSYS2 environment.
This is one of those deals where if you don’t know what that means, you don’t need them. Once you become familiar with MSYS2, it will make more sense. But, in general, if you are a Windows user who wants to be able to compile COBOL programs, one of the self-extractors is what you want.
After downloading one of those files, and while running in the MSYS2 environment, use
pacman -U <filename> to install it.