Using Zeus with GnuCOBOL 3.1.1
Posted: Tue Dec 22, 2020 8:55 am
1. Go to the following download page an select from the various versions of GnuCOBOL available: https://www.arnoldtrembley.com/GnuCOBOL.htm
The list of options includes:
2. Download and install the contents of the zip file into this folder location.
NOTE: An alternative folder location can also be used, the batch file that follows will need to be modified to suit. In addition if that folder location contains white space some extra care will be needed as the folder location will need to be wrapped in quotes. As such it is best to start with a folder location that does not contain white space.
3. Add the following folder location to the PATH making sure to include the extra bin folder as shown:
More details about the PATH can be found here: http://www.zeusedit.com/phpBB3/viewtopic.php?f=5&t=6176
4. Start the Zeus IDE and check the PATH has been correctly configure by using the Tools, DOS Command Line menu to run the following command:
Running that command should result in the following output:
IMPORTANT NOTE:
If the installation folder used in the earlier step was changed then this batch file will need to be changed to match that new installation folder.
5. Using the Options, Document Types menu edit the COBOL Document Type and in the Compiler section enter in the following compiler command:
6. Create a new test.cob file in the c:\temp folder using the following code:
7. With the file as the active document use the Zeus Compiler, Compile menu to run the COBOL compiler.
8. After the compiler runs use the Macros, Execute 'test.exe' menu to run the file and the following output should be produced:
When running the compile an error similar to the following might be produced:
Reading the error it is clear the GnuCOBOL compiler has picked up the stddef.h file from this location:
The list of options includes:
- GnuCOBOL 3.1.1 BDB MinGW GnuCOBOL Compiler Includes Berkeley DataBase 18.1.40 for Indexed Sequential file access support, GMP 6.2.0, and PDCursesMod 4.2.0 (18.3 megabytes). Rename .7z to .exe for self-extracting archive.
- GnuCOBOL 3.1.1 VBISAM MinGW GnuCOBOL Compiler Includes VBISAM 2.0.1 for Indexed Sequential file access support, GMP 6.2.0, and PDCursesMod 4.2.0 (17.1 megabytes). Rename .7z to .exe for self-extracting archive.
- GnuCOBOL 3.1.1 NODB MinGW GnuCOBOL Compiler Without any ISAM support (NODB). This version includes GMP 6.2.0 and PDCursesMod 4.2.0 (17.0 megabytes). Rename .7z to .exe for self-extracting archive.
- GnuCOBOL 3.1.1 BDB Diagnostic MinGW GnuCOBOL Includes Berkeley DataBase 18.1.40 for Indexed Sequential file access support, GMP 6.2.0, and PDCursesMod 4.2.0 (23.5 megabytes). Also includes FULL support for debugging GnuCOBOL 3.1.1 COMPILER INTERNALS. Rename .7z to .exe for self-extracting archive.
2. Download and install the contents of the zip file into this folder location.
Code: Select all
c:\GnuCOBOL\
3. Add the following folder location to the PATH making sure to include the extra bin folder as shown:
Code: Select all
c:\GnuCOBOL\bin\
4. Start the Zeus IDE and check the PATH has been correctly configure by using the Tools, DOS Command Line menu to run the following command:
Code: Select all
cobc -V
If instead the following output is produced re-check the PATH settings as this output indicates the PATH setting is wrong:cobc (GnuCOBOL) 3.1.1.0
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
Built Dec 09 2020 16:46:55
Packaged Dec 08 2020 22:56:13 UTC
C version (MinGW) "6.3.0"
Create the following cobol.bat file in the c:\GnuCOBOL\bin\ folder:'cobc' is not recognized as an internal or external command, operable program or batch file.
Code: Select all
@ECHO OFF
:: Batch file to run the GnuCOBOL compiler
:: GnuCOBOL compiler env strings
SET COB_MAIN_DIR=c:\GnuCOBOL\
SET COB_CONFIG_DIR=%COB_MAIN_DIR%config
SET COB_COPY_DIR=%COB_MAIN_DIR%copy
SET COB_CFLAGS=-I"%COB_MAIN_DIR%include" %COB_CFLAGS%
SET COB_LDFLAGS=-L"%COB_MAIN_DIR%lib" %COB_LDFLAGS%
SET COB_LIBRARY_PATH=%COB_MAIN_DIR%extras
:: Compile the COBOL file provided
cobc.exe -x %1
If the installation folder used in the earlier step was changed then this batch file will need to be changed to match that new installation folder.
5. Using the Options, Document Types menu edit the COBOL Document Type and in the Compiler section enter in the following compiler command:
Code: Select all
cobol.bat "$fn"
Code: Select all
id division.
program-id. hellow.
procedure division.
display 'GnuCOBOL - Hello world.'.
8. After the compiler runs use the Macros, Execute 'test.exe' menu to run the file and the following output should be produced:
IMPORTANT NOTE:GnuCOBOL - Hello world.
When running the compile an error similar to the following might be produced:
This can happen when an older version of the GCC compiler is installed on the machine.In file included from C:/Utilities/Perl/c/i686-w64-mingw32/include/stddef.h:7:0,
from C:/Utilities/Perl/c/lib/gcc/i686-w64-mingw32/4.9.2/include/stddef.h:1,
from c:\GnuCOBOL\include/stdio.h:69,
from C:\Users\Jussi\AppData\Local\Temp\cob83248_0.c:8:
C:/Utilities/Perl/c/i686-w64-mingw32/include/crtdefs.h:123:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'typedef'
__MINGW_EXTENSION typedef __int64 __time64_t;
^
C:/Utilities/Perl/c/i686-w64-mingw32/include/crtdefs.h:138:9: error: unknown type name '__time64_t'
Reading the error it is clear the GnuCOBOL compiler has picked up the stddef.h file from this location:
However it should have found the the GnuCOBOL installation version of that file found here:C:\Utilities\Perl\c\i686-w64-mingw32\include\stddef.h
Cheers JussiC:\GnuCOBOL\lib\gcc\mingw32\6.3.0\include\stddef.h