I found out that on page
Visual COBOL Personal Edition can be downloaded a trial edition of the Micro Focus Visual COBOL compiler. So I decided to register, download the installer for Eclipse (1 GB), activate the license and make use of it with a small "HELLO WORD" COBOL source file I found in world wide web.
I installed Micro Focus Visual COBOL 6.0 into
C:\Cobol32. There was an error during the installation because of no Visual Studio Tools installed on my machine. That error during installation causes finally linker errors because of missing compatible Windows libraries and tools. However, these linker errors because of missing compatible *.lib files of Windows do not matter for creation of the compiler configuration.
Installation directory (compiler path)
I found out that the installer creates under registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Micro Focus\Visual COBOL\6.0 a string value with name
INSTALLDIR with the string value
C:\Cobol32\. The updated compiler configuration evaluates this registry string value with following line in section
[Variables].
CPATH =
$(HKEY_LOCAL_MACHINE\SOFTWARE$6432\Micro Focus\Visual Cobol\$(Compiler Version)\INSTALLDIR)
So the user of the compiler configuration does not need to manually define the installation directory of the Micro Focus Visual COBOL compiler.
I don't know if the installers of version
5.0 and version
4.0 of Micro Focus Visual COBOL compiler create also an appropriate registry key with the string value
INSTALLDIR containing the path to the installation directory which ends with a backslash. I suppose that this is the case. So I added a general compiler option with name
Compiler Version with the three options
6.0 (default),
5.0 and
4.0. A user like you using the attached compiler configuration must select the appropriate version on not using currently latest version
6.0.
Please let me know if version 4.0 is installed with creation of registry key HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Micro Focus\Visual COBOL\4.0 with a string value with name INSTALLDIR and with string value C:\Cobol32\ (backslash at end).
Environment variables
Micro Focus Visual COBOL 6.0 is installed with 32-bit and 64-bit binaries. I added the general compiler option
Compiler Architecture to give the user of the compiler configuration the possibility to choose between 32-bit or 64-bit
cobol.exe and
cbllink.exe.
I could see further that under registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Micro Focus\Visual COBOL\6.0\COBOL\Environment are several strings defined which define the environment on execution. In directory
C:\Cobol32 are installed the two batch files
CreateEnv.bat and
SetupEnv.bat. I looked on them and found out that the environment is created by running either
C:\Cobol32\bin\cblpromp.exe or C:\Cobol32\bin64\cblpromp.exe with output redirected into a temporary batch file which is called next to define the environment variables.
Output of
C:\Cobol32\bin\cblpromp.exe:
Code: Select all
@SET COBDIR=C:\Cobol32\;%COBDIR%
@SET PATH=C:\Cobol32\bin\;C:\Cobol32\binn\;C:\Cobol32\AdoptRedis;%PATH%
@SET LIB=C:\Cobol32\lib\;%LIB%
@SET COBCPY=%COBCPY%;C:\Cobol32\cpylib\;C:\Cobol32\cpylib\basecl;C:\Cobol32\cpylib\guicl;C:\Cobol32\cpylib\olecl
@SET MFTRACE_ANNOTATIONS=C:\Cobol32\etc\mftrace\annotations
@SET MFTRACE_LOGS=C:\ProgramData\Micro Focus\Visual COBOL\6.0\mftrace\logs
@SET INCLUDE=C:\Cobol32\include;%INCLUDE%
@SET CLASSPATH=C:\Cobol32\bin\mfcobol.jar;C:\Cobol32\bin\mfcobolrts.jar;C:\Cobol32\bin\mfsqljvm.jar;C:\Cobol32\bin\mfunit.jar;C:\Cobol32\bin\mfidmr.jar;C:\Cobol32\bin\mfle370.jar;%CLASSPATH%
@SET MFDBFH_SCRIPT_DIR=C:\Cobol32\etc\mfdbfh\scripts
@SET DSGDIR=C:\Users\Public\Documents\Micro Focus\Visual COBOL\;C:\Cobol32\Bin
@SET TXDIR=C:\Cobol32\
@SET COBREG_PARSED=True
Output of
C:\Cobol32\bin64\cblpromp.exe:
Code: Select all
@SET COBDIR=C:\Cobol32\;%COBDIR%
@SET PATH=C:\Cobol32\bin64\;C:\Cobol32\binn64\;C:\Cobol32\bin\;C:\Cobol32\AdoptOpenJDK\bin;C:\Cobol32\AdoptRedis;%PATH%
@SET LIB=C:\Cobol32\lib64\;%LIB%
@SET COBCPY=%COBCPY%;C:\Cobol32\cpylib\;C:\Cobol32\cpylib\basecl
@SET MFTRACE_ANNOTATIONS=C:\Cobol32\etc\mftrace\annotations
@SET MFTRACE_LOGS=C:\ProgramData\Micro Focus\Visual COBOL\6.0\mftrace\logs
@SET INCLUDE=C:\Cobol32\include;%INCLUDE%
@SET JAVA_HOME=C:\Cobol32\AdoptOpenJDK
@SET CLASSPATH=C:\Cobol32\bin\mfcobol.jar;C:\Cobol32\bin\mfcobolrts.jar;C:\Cobol32\bin\mfsqljvm.jar;C:\Cobol32\bin\mfunit.jar;C:\Cobol32\bin\mfidmr.jar;C:\Cobol32\bin64\mfle370.jar;%CLASSPATH%
@SET MFDBFH_SCRIPT_DIR=C:\Cobol32\etc\mfdbfh\scripts
@SET TXDIR=C:\Cobol32\
@SET COBREG_64_PARSED=True
I analyzed which environment variables are used by which executable or DLL and found out that for
cobol.exe and
cbllink.exe only the environment variables are necessary which are defined in the attached compiler configuration in section
[Environment]. The other environment variables are not needed for compilation and linking.
I added
$(CPATH)exedll; to
PATH although such a directory does not exist on using version 6.0 of the Micro Focus Visual COBOL compiler. That is for compatibility with your installed version 4.0.
I added
$(CPATH)lbr to
LIB although such a directory does not exist on using version 6.0 of the Micro Focus Visual COBOL compiler. That is for compatibility with your installed version 4.0.
Update compiler configuration
Please download the attached ZIP file. Next extract the file
Application in the ZIP file to the directory
C:\workarea\cobol32\coboltest\Configs\COBOL Compiler\ while UEStudio is not running and overwrite the existing file.
Then start UEStudio, open the
Compiler Options dialog window, click first on button
Default, next double click on
Compiler Version and select
4.0, close all dialog windows with
X and run a
Build.
I expect a working build.
But if there is an error output because of
cobol.exe is not found, the compiler configuration must be adapted as the line
CPATH =
$(HKEY_LOCAL_MACHINE\SOFTWARE$6432\Micro Focus\Visual Cobol\$(Compiler Version)\INSTALLDIR) is not working for your installation of Micro Focus Visual COBOL compiler version
4.0. Modify this line to
CPATH =
C:\Cobol32\ (backslash at end is important) and let me know that the query of the installation directory from Windows registry does not work for version
4.0.
I used on my tests the file
coboltest.cbl with following lines:
Code: Select all
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLOWRD.
PROCEDURE DIVISION.
DISPLAY "SIMPLE HELLO WORLD".
STOP RUN.
The compilation with 32-bit and 64-bit
cobol.exe worked with the attached compiler configuration in all four possible variations:
- *.obj file with no *.lst and *.grp file (default).
- *.obj file with *.lst and no *.grp file.
- *.obj file with no *.lst but with *.grp file.
- *.obj file with *.lst and with *.grp file.
Linking with 32-bit and 64-bit
cbllink.exe worked also taking into account on my incomplete installation that there are three linker errors because of missing symbols defined in cblrtsmi.lib not found in the *.lib which I copied from Visual Studio 2010. I suppose I would need the Windows libraries from Visual Studio 2019 for a successful linking with cblrtsmi.lib.