Menu

Getting Started: esqlOC by Sergey

ati
2013-11-10
2023-12-06
<< < 1 2 3 > >> (Page 2 of 3)
  • Simon Sobisch

    Simon Sobisch - 2020-06-10

    @jklowden: I've edited your post to fix the link to the current gitea repo and included a link to the esqlOC place under contrib. I want to encourage you to do the later also in your repo's README and possibly switch your local contrib symlink to a getEsql.sh that places it in that folder + have it git.ignore'd.

     
    • James K. Lowden

      James K. Lowden - 2020-06-11

      Thanks, Simon. So far, my user count is 0 with a possibility of 1. As the work continues, if there's interest, I'll look for a better way to package it. Probably best is just to require esql be installed, and remove the symlink altogether.

       
  • celsofigueiredo

    celsofigueiredo - 2020-06-11

    Dears friends.

    Thank you James K. Lowden, I will redo this example here, again, then I will pass on the result to you. I hope I don't have to configure anything, as I'm not good at doing that.

    Celso Henrique

     
  • celsofigueiredo

    celsofigueiredo - 2020-08-16

    Dears friends.
    I went to run this program on windows 10, but gave the following error:

    C:\Cobol>SET esqlOC_RUNTIME=c:\esqlOC\release
    
    C:\Cobol>call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
    
    C:\Cobol>cobc -fixed -v -x -static -o esqlOCGetStart1.exe esqlOCGetStart1.cob
    cobc (GnuCOBOL) 3.1-dev.0
    Built     Mar 24 2020 20:55:56  Packaged  Mar 22 2020 20:37:48 UTC
    C version (MinGW) "6.3.0"
    loading standard configuration file 'default.conf'
    command line:   cobc -fixed -v -x -static -o esqlOCGetStart1.exe esqlOCGetStart1.cob
    preprocessing:  esqlOCGetStart1.cob -> C:\Users\Celso\AppData\Local\Temp\cob17932_0.cob
    return status:  0
    parsing:        C:\Users\Celso\AppData\Local\Temp\cob17932_0.cob (esqlOCGetStart1.cob)
    esqlOCGetStart1.cob: in section 'MAIN':
    esqlOCGetStart1.cob:318: warning: ignoring redundant .
    esqlOCGetStart1.cob: in section 'SQLSTATE-CHECK':
    esqlOCGetStart1.cob:337: warning: ignoring redundant .
    return status:  0
    translating:    C:\Users\Celso\AppData\Local\Temp\cob17932_0.cob -> C:\Users\Celso\AppData\Local\Temp\cob17932_0.c (esqlOCGetStart1.cob)
    executing:      gcc -c -I"C:\OpenCobolIDE\GnuCOBOL\include" -o
                    "C:\Users\Celso\AppData\Local\Temp\cob17932_0.o"
                    "C:\Users\Celso\AppData\Local\Temp\cob17932_0.c"
    return status:  0
    executing:      gcc -Wl,--export-all-symbols -Wl,--enable-auto-import
                    -Wl,--enable-auto-image-base -o "esqlOCGetStart1.exe"
                    "C:\Users\Celso\AppData\Local\Temp\cob17932_0.o"
                    -L"C:\OpenCobolIDE\GnuCOBOL\lib" -L/mingw/lib -lcob -lm
    C:\Users\Celso\AppData\Local\Temp\cob17932_0.o:cob17932_0.c:(.text+0x249): undefined reference to `OCSQL'
    C:\Users\Celso\AppData\Local\Temp\cob17932_0.o:cob17932_0.c:(.text+0x39b): undefined reference to `OCSQLIMM'
    C:\Users\Celso\AppData\Local\Temp\cob17932_0.o:cob17932_0.c:(.text+0x577): undefined reference to `OCSQLIMM'
    C:\Users\Celso\AppData\Local\Temp\cob17932_0.o:cob17932_0.c:(.text+0x799): undefined reference to `OCSQLIMM'
    C:\Users\Celso\AppData\Local\Temp\cob17932_0.o:cob17932_0.c:(.text+0x91e): undefined reference to `OCSQLPRE'
    C:\Users\Celso\AppData\Local\Temp\cob17932_0.o:cob17932_0.c:(.text+0x97d): undefined reference to `OCSQLEXE'
    C:\Users\Celso\AppData\Local\Temp\cob17932_0.o:cob17932_0.c:(.text+0xb2c): undefined reference to `OCSQLPRE'
    C:\Users\Celso\AppData\Local\Temp\cob17932_0.o:cob17932_0.c:(.text+0xb8b): undefined reference to `OCSQLOCU'
    C:\Users\Celso\AppData\Local\Temp\cob17932_0.o:cob17932_0.c:(.text+0xcff): undefined reference to `OCSQLFTC'
    C:\Users\Celso\AppData\Local\Temp\cob17932_0.o:cob17932_0.c:(.text+0xe64): undefined reference to `OCSQLCMT'
    C:\Users\Celso\AppData\Local\Temp\cob17932_0.o:cob17932_0.c:(.text+0xed4): undefined reference to `OCSQLDIS'
    C:\Users\Celso\AppData\Local\Temp\cob17932_0.o:cob17932_0.c:(.text+0x13a2): undefined reference to `OCSQLPRE'
    C:\Users\Celso\AppData\Local\Temp\cob17932_0.o:cob17932_0.c:(.text+0x1417): undefined reference to `OCSQLEXE'
    C:\Users\Celso\AppData\Local\Temp\cob17932_0.o:cob17932_0.c:(.text+0x16b0): undefined reference to `OCSQLPRE'
    C:\Users\Celso\AppData\Local\Temp\cob17932_0.o:cob17932_0.c:(.text+0x1725): undefined reference to `OCSQLEXE'
    C:\Users\Celso\AppData\Local\Temp\cob17932_0.o:cob17932_0.c:(.text+0x1a21): undefined reference to `OCSQLPRE'
    C:\Users\Celso\AppData\Local\Temp\cob17932_0.o:cob17932_0.c:(.text+0x1ac2): undefined reference to `OCSQLEXE'
    collect2.exe: error: ld returned 1 exit status
    return status:  1
    

    Where am I going wrong?

    Celso Henrique

     
    • Simon Sobisch

      Simon Sobisch - 2020-08-16

      adding -L"%esqlOC_RUNTIME%" -ocsql may help, otherwise try adding %esqlOC_RUNTIME%\ocsql.lib directly.

       
  • celsofigueiredo

    celsofigueiredo - 2020-08-16

    Dear Simon.

    I didn't understand what it is to do.

    Celso Henrique.

     
    • Simon Sobisch

      Simon Sobisch - 2020-08-16

      You're using a GCC based version, therefore you can drop the vcvarsall call. As -fixedis the default you also don't need to specify it on the command line. But in any case it is necessary to tell cobc to link against the library and where to found it. So this gives two possible command lines... and a possible third I did not thought about before:

      cobc -v -x -static -o esqlOCGetStart1.exe %esqlOC_RUNTIME%\ocsql.lib esqlOCGetStart1.cob
      
      cobc -v -x -static -o esqlOCGetStart1.exe -L"%esqlOC_RUNTIME%" -ocsql esqlOCGetStart1.cob
      
      cobc -v -x -static -o esqlOCGetStart1.exe -Q"%esqlOC_RUNTIME%\ocsql.dll" esqlOCGetStart1.cob
      

      ... but this looks like a mixture of GCC and VS-based libraries which may/may not work that way.

       
  • celsofigueiredo

    celsofigueiredo - 2020-08-16

    Dear Simon

    I tested it with the three forms above, but only the second one compiled it, but it still gives an error :

    C:\Cobol>call "C:\OpenCobolIDE\GnuCOBOL\set_env.cmd"
    
    Setting environment for GnuCOBOL 3.1-dev0 (22Mar2020) with MinGW binaries
    (GCC 6.3.0, PDcurses 3.9, GMP 6.2.0, BDB 18.1.32)
    
    cobc (GnuCOBOL) 3.1-dev.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     Mar 24 2020 20:55:56
    Packaged  Mar 22 2020 20:37:48 UTC
    C version (MinGW) "6.3.0"
    
    C:\Cobol>cobc -v -x -static -o esqlOCGetStart1.exe %esqlOC_RUNTIME%\ocsql.lib esqlOCGetStart1.cob
    cobc (GnuCOBOL) 3.1-dev.0
    Built     Mar 24 2020 20:55:56  Packaged  Mar 22 2020 20:37:48 UTC
    C version (MinGW) "6.3.0"
    loading standard configuration file 'default.conf'
    command line:   cobc -v -x -static -o esqlOCGetStart1.exe %esqlOC_RUNTIME%\ocsql.lib esqlOCGetStart1.cob
    cobc: %esqlOC_RUNTIME%\ocsql.lib: No such file or directory
    
    C:\Cobol>cobc -v -x -static -o esqlOCGetStart1.exe -L"%esqlOC_RUNTIME%" -ocsql esqlOCGetStart1.cob
    cobc (GnuCOBOL) 3.1-dev.0
    Built     Mar 24 2020 20:55:56  Packaged  Mar 22 2020 20:37:48 UTC
    C version (MinGW) "6.3.0"
    loading standard configuration file 'default.conf'
    command line:   cobc -v -x -static -o esqlOCGetStart1.exe -L%esqlOC_RUNTIME% -ocsql esqlOCGetStart1.cob
    preprocessing:  esqlOCGetStart1.cob -> C:\Users\Celso\AppData\Local\Temp\cob18804_0.cob
    return status:  0
    parsing:        C:\Users\Celso\AppData\Local\Temp\cob18804_0.cob (esqlOCGetStart1.cob)
    esqlOCGetStart1.cob: in section 'MAIN':
    esqlOCGetStart1.cob:318: warning: ignoring redundant .
    esqlOCGetStart1.cob: in section 'SQLSTATE-CHECK':
    esqlOCGetStart1.cob:337: warning: ignoring redundant .
    return status:  0
    translating:    C:\Users\Celso\AppData\Local\Temp\cob18804_0.cob -> C:\Users\Celso\AppData\Local\Temp\cob18804_0.c (esqlOCGetStart1.cob)
    executing:      gcc -c -I"C:\OpenCobolIDE\GnuCOBOL\include" -o
                    "C:\Users\Celso\AppData\Local\Temp\cob18804_0.o"
                    "C:\Users\Celso\AppData\Local\Temp\cob18804_0.c"
    return status:  0
    executing:      gcc -Wl,--export-all-symbols -Wl,--enable-auto-import
                    -Wl,--enable-auto-image-base -o "csql"
                    "C:\Users\Celso\AppData\Local\Temp\cob18804_0.o"
                    -L"C:\OpenCobolIDE\GnuCOBOL\lib" -L/mingw/lib -lcob -lm
    C:\Users\Celso\AppData\Local\Temp\cob18804_0.o:cob18804_0.c:(.text+0x249): undefined reference to `OCSQL'
    C:\Users\Celso\AppData\Local\Temp\cob18804_0.o:cob18804_0.c:(.text+0x39b): undefined reference to `OCSQLIMM'
    C:\Users\Celso\AppData\Local\Temp\cob18804_0.o:cob18804_0.c:(.text+0x577): undefined reference to `OCSQLIMM'
    C:\Users\Celso\AppData\Local\Temp\cob18804_0.o:cob18804_0.c:(.text+0x799): undefined reference to `OCSQLIMM'
    C:\Users\Celso\AppData\Local\Temp\cob18804_0.o:cob18804_0.c:(.text+0x91e): undefined reference to `OCSQLPRE'
    C:\Users\Celso\AppData\Local\Temp\cob18804_0.o:cob18804_0.c:(.text+0x97d): undefined reference to `OCSQLEXE'
    C:\Users\Celso\AppData\Local\Temp\cob18804_0.o:cob18804_0.c:(.text+0xb2c): undefined reference to `OCSQLPRE'
    C:\Users\Celso\AppData\Local\Temp\cob18804_0.o:cob18804_0.c:(.text+0xb8b): undefined reference to `OCSQLOCU'
    C:\Users\Celso\AppData\Local\Temp\cob18804_0.o:cob18804_0.c:(.text+0xcff): undefined reference to `OCSQLFTC'
    C:\Users\Celso\AppData\Local\Temp\cob18804_0.o:cob18804_0.c:(.text+0xe64): undefined reference to `OCSQLCMT'
    C:\Users\Celso\AppData\Local\Temp\cob18804_0.o:cob18804_0.c:(.text+0xed4): undefined reference to `OCSQLDIS'
    C:\Users\Celso\AppData\Local\Temp\cob18804_0.o:cob18804_0.c:(.text+0x13a2): undefined reference to `OCSQLPRE'
    C:\Users\Celso\AppData\Local\Temp\cob18804_0.o:cob18804_0.c:(.text+0x1417): undefined reference to `OCSQLEXE'
    C:\Users\Celso\AppData\Local\Temp\cob18804_0.o:cob18804_0.c:(.text+0x16b0): undefined reference to `OCSQLPRE'
    C:\Users\Celso\AppData\Local\Temp\cob18804_0.o:cob18804_0.c:(.text+0x1725): undefined reference to `OCSQLEXE'
    C:\Users\Celso\AppData\Local\Temp\cob18804_0.o:cob18804_0.c:(.text+0x1a21): undefined reference to `OCSQLPRE'
    C:\Users\Celso\AppData\Local\Temp\cob18804_0.o:cob18804_0.c:(.text+0x1ac2): undefined reference to `OCSQLEXE'
    collect2.exe: error: ld returned 1 exit status
    return status:  1
    
    C:\Cobol>cobc -v -x -static -o esqlOCGetStart1.exe -Q"%esqlOC_RUNTIME%\ocsql.dll" esqlOCGetStart1.cob
    cobc (GnuCOBOL) 3.1-dev.0
    Built     Mar 24 2020 20:55:56  Packaged  Mar 22 2020 20:37:48 UTC
    C version (MinGW) "6.3.0"
    cobc: unrecognized option '-Q%esqlOC_RUNTIME%\ocsql.dll'
    

    Celso Henrique.

     
    • Simon Sobisch

      Simon Sobisch - 2020-08-16

      The second one was a typo by me, should have been -locsql, for the third place a space after the -Q - and in all three cases: esnure that esqlOC_RUNTIME is set as you've previously did.

       
  • celsofigueiredo

    celsofigueiredo - 2020-08-16

    Dear Simon

    Correcting for the correct form, gave the following:

    C:\Cobol>cobc -v -x -static -o esqlOCGetStart1.exe -L"%esqlOC_RUNTIME%" -locsql esqlOCGetStart1.cob
    cobc (GnuCOBOL) 3.1-dev.0
    Built     Mar 24 2020 20:55:56  Packaged  Mar 22 2020 20:37:48 UTC
    C version (MinGW) "6.3.0"
    loading standard configuration file 'default.conf'
    command line:   cobc -v -x -static -o esqlOCGetStart1.exe -Lc:\esqlOC\x64\release -locsql esqlOCGetStart1.cob
    preprocessing:  esqlOCGetStart1.cob -> C:\Users\Celso\AppData\Local\Temp\cob14308_0.cob
    return status:  0
    parsing:        C:\Users\Celso\AppData\Local\Temp\cob14308_0.cob (esqlOCGetStart1.cob)
    esqlOCGetStart1.cob: in section 'MAIN':
    esqlOCGetStart1.cob:318: warning: ignoring redundant .
    esqlOCGetStart1.cob: in section 'SQLSTATE-CHECK':
    esqlOCGetStart1.cob:337: warning: ignoring redundant .
    return status:  0
    translating:    C:\Users\Celso\AppData\Local\Temp\cob14308_0.cob -> C:\Users\Celso\AppData\Local\Temp\cob14308_0.c (esqlOCGetStart1.cob)
    executing:      gcc -c -I"C:\OpenCobolIDE\GnuCOBOL\include" -o
                    "C:\Users\Celso\AppData\Local\Temp\cob14308_0.o"
                    "C:\Users\Celso\AppData\Local\Temp\cob14308_0.c"
    return status:  0
    executing:      gcc -Wl,--export-all-symbols -Wl,--enable-auto-import
                    -Wl,--enable-auto-image-base -o "esqlOCGetStart1.exe"
                    "C:\Users\Celso\AppData\Local\Temp\cob14308_0.o"
                    -L"C:\OpenCobolIDE\GnuCOBOL\lib" -L"c:\esqlOC\x64\release"
                    -L/mingw/lib -lcob -lm -l"ocsql"
    C:\Users\Celso\AppData\Local\Temp\cob14308_0.o:cob14308_0.c:(.text+0x249): undefined reference to `OCSQL'
    C:\Users\Celso\AppData\Local\Temp\cob14308_0.o:cob14308_0.c:(.text+0x39b): undefined reference to `OCSQLIMM'
    C:\Users\Celso\AppData\Local\Temp\cob14308_0.o:cob14308_0.c:(.text+0x577): undefined reference to `OCSQLIMM'
    C:\Users\Celso\AppData\Local\Temp\cob14308_0.o:cob14308_0.c:(.text+0x799): undefined reference to `OCSQLIMM'
    C:\Users\Celso\AppData\Local\Temp\cob14308_0.o:cob14308_0.c:(.text+0x91e): undefined reference to `OCSQLPRE'
    C:\Users\Celso\AppData\Local\Temp\cob14308_0.o:cob14308_0.c:(.text+0x97d): undefined reference to `OCSQLEXE'
    C:\Users\Celso\AppData\Local\Temp\cob14308_0.o:cob14308_0.c:(.text+0xb2c): undefined reference to `OCSQLPRE'
    C:\Users\Celso\AppData\Local\Temp\cob14308_0.o:cob14308_0.c:(.text+0xb8b): undefined reference to `OCSQLOCU'
    C:\Users\Celso\AppData\Local\Temp\cob14308_0.o:cob14308_0.c:(.text+0xcff): undefined reference to `OCSQLFTC'
    C:\Users\Celso\AppData\Local\Temp\cob14308_0.o:cob14308_0.c:(.text+0xe64): undefined reference to `OCSQLCMT'
    C:\Users\Celso\AppData\Local\Temp\cob14308_0.o:cob14308_0.c:(.text+0xed4): undefined reference to `OCSQLDIS'
    C:\Users\Celso\AppData\Local\Temp\cob14308_0.o:cob14308_0.c:(.text+0x13a2): undefined reference to `OCSQLPRE'
    C:\Users\Celso\AppData\Local\Temp\cob14308_0.o:cob14308_0.c:(.text+0x1417): undefined reference to `OCSQLEXE'
    C:\Users\Celso\AppData\Local\Temp\cob14308_0.o:cob14308_0.c:(.text+0x16b0): undefined reference to `OCSQLPRE'
    C:\Users\Celso\AppData\Local\Temp\cob14308_0.o:cob14308_0.c:(.text+0x1725): undefined reference to `OCSQLEXE'
    C:\Users\Celso\AppData\Local\Temp\cob14308_0.o:cob14308_0.c:(.text+0x1a21): undefined reference to `OCSQLPRE'
    C:\Users\Celso\AppData\Local\Temp\cob14308_0.o:cob14308_0.c:(.text+0x1ac2): undefined reference to `OCSQLEXE'
    collect2.exe: error: ld returned 1 exit status
    return status:  1
    
    C:\Cobol>cobc -v -x -static -o esqlOCGetStart1.exe -Q "%esqlOC_RUNTIME%\ocsql.dll" esqlOCGetStart1.cob
    cobc (GnuCOBOL) 3.1-dev.0
    Built     Mar 24 2020 20:55:56  Packaged  Mar 22 2020 20:37:48 UTC
    C version (MinGW) "6.3.0"
    loading standard configuration file 'default.conf'
    command line:   cobc -v -x -static -o esqlOCGetStart1.exe -Q c:\esqlOC\x64\release\ocsql.dll esqlOCGetStart1.cob
    preprocessing:  esqlOCGetStart1.cob -> C:\Users\Celso\AppData\Local\Temp\cob1204_0.cob
    return status:  0
    parsing:        C:\Users\Celso\AppData\Local\Temp\cob1204_0.cob (esqlOCGetStart1.cob)
    esqlOCGetStart1.cob: in section 'MAIN':
    esqlOCGetStart1.cob:318: warning: ignoring redundant .
    esqlOCGetStart1.cob: in section 'SQLSTATE-CHECK':
    esqlOCGetStart1.cob:337: warning: ignoring redundant .
    return status:  0
    translating:    C:\Users\Celso\AppData\Local\Temp\cob1204_0.cob -> C:\Users\Celso\AppData\Local\Temp\cob1204_0.c (esqlOCGetStart1.cob)
    executing:      gcc -c -I"C:\OpenCobolIDE\GnuCOBOL\include" -o
                    "C:\Users\Celso\AppData\Local\Temp\cob1204_0.o"
                    "C:\Users\Celso\AppData\Local\Temp\cob1204_0.c"
    return status:  0
    executing:      gcc -Wl,--export-all-symbols -Wl,--enable-auto-import
                    -Wl,--enable-auto-image-base -o "esqlOCGetStart1.exe"
                    "C:\Users\Celso\AppData\Local\Temp\cob1204_0.o"
                    -L"C:\OpenCobolIDE\GnuCOBOL\lib"
                    c:\esqlOC\x64\release\ocsql.dll -L/mingw/lib -lcob -lm
    c:\esqlOC\x64\release\ocsql.dll: file not recognized: File format not recognized
    collect2.exe: error: ld returned 1 exit status
    return status:  1
    

    Celso Henrique.

    Where am I going wrong?

     
    • Simon Sobisch

      Simon Sobisch - 2020-08-16

      I guess both ways will work if you use a matching architecture - cobc --info likely reports itself as 32bit, doesn't it? In this case use the x86 directory of esqloc (or a 64bit version of cobc if you want to stick to x64).

       
  • celsofigueiredo

    celsofigueiredo - 2020-08-16

    Dear Simon.

    cobc is:

    Microsoft Windows [versão 10.0.18363.1016]
    (c) 2019 Microsoft Corporation. Todos os direitos reservados.
    
    C:\Users\Celso>cobc --info
    cobc (GnuCOBOL) 3.1-dev.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     Mar 24 2020 20:55:56
    Packaged  Mar 22 2020 20:37:48 UTC
    C version (MinGW) "6.3.0"
    
    build information
    build environment        : i686-pc-mingw32
    CC                       : gcc
    C version                : (MinGW) "6.3.0"
    CPPFLAGS                 : -I/mingw/include
    CFLAGS                   : -O2 -pipe -finline-functions -fsigned-char
                               -Wall -Wwrite-strings -Wmissing-prototypes
                               -Wno-format-y2k -U_FORTIFY_SOURCE
    LD                       : c:/gcbuild/mingw/mingw32/bin/ld.exe
    LDFLAGS                  :
    
    GnuCOBOL information
    COB_CC                   : gcc
    COB_CFLAGS               : -I/mingw/include -Wno-unused -fsigned-char
                               -Wno-pointer-sign -I/mingw/include -pipe
    COB_LDFLAGS              :
    COB_LIBS                 : -L/mingw/lib -lcob -lm
    COB_CONFIG_DIR           : /mingw/share/gnucobol/config
    COB_COPY_DIR             : /mingw/share/gnucobol/copy
    COB_MSG_FORMAT           : GCC
    COB_OBJECT_EXT           : o
    COB_MODULE_EXT           : dll
    COB_EXE_EXT              : .exe
    64bit-mode               : no
    BINARY-C-LONG            : 4 bytes
    endianness               : little-endian
    native EBCDIC            : no
    extended screen I/O      : pdcurses
    variable file format     : 0
    sequential file handler  : built-in
    ISAM file handler        : BDB
    mathematical library     : GMP
    XML library              : disabled
    JSON library             : cJSON
    
    C:\Users\Celso>
    

    what am I doing wrong?

    Celso Henrique.

    P.S.:
    GNUcobol in a LINUX environment, I can already develop more; but GNUcobol in windows 10 environment, I am completely lost.

     
    • Simon Sobisch

      Simon Sobisch - 2020-08-16

      what am I doing wrong?

      esqlOC_RUNTIME should point to the x86 directory, not the x64 one as it must match the version of cobc (and yours says "64bit-mode: no")

       
  • celsofigueiredo

    celsofigueiredo - 2020-08-16

    Dears.

    One thing I find strange, is that, every time I go to DOS, I have to type the following command: " call "C: \ OpenCobolIDE \ GnuCOBOL \ set_env.cmd " ". what I have to do, so that I don’t have to type this command every time.

    Celso Henrique.

     
    • Simon Sobisch

      Simon Sobisch - 2020-08-16

      Take a decision: either use a minimal wrapper (safe but a bit overhead) that is placed in PATH or set it up similar to the GNU/Linux environment.

      For the first option:

      • setx PATH=%PATH%;C:\OpenCobolIDE\GnuCOBOL\bin
      • put cobc.cmd and cobcrun.cmd there, that look like the following ("obviously" with very similar content):
      @echo off
      call C:\OpenCobolIDE\GnuCOBOL\bin\set_env.cmd
      cobc.exe %*
      

      For the second option:

      • run C:\OpenCobolIDE\GnuCOBOL\bin\set_env.cmd once
      • run set COB to see all GnuCOBOL related variables
      • for each of those run setx COB...=%COB...%
      • take a decission:
      • possibly break something in windows by bringing in some linux commands: setx PATH=C:\OpenCobolIDE\GnuCOBOL\bin;%PATH%
      • possibly break something in GnuCOBOL (if this is the case then you'd need to manually set it back via comptuer management -> environment variables and use the first main option): setx PATH=%PATH%;C:\OpenCobolIDE\GnuCOBOL\bin
       
  • celsofigueiredo

    celsofigueiredo - 2020-08-16

    Dear Simon.

    My system are windows 10 ---> 64bits
    my GNUcobol ---> 64 bits
    too

    Celso Henrique

     
    • Simon Sobisch

      Simon Sobisch - 2020-08-17

      Hm, no? Actually I've explicit added the 64bit-mode output to cobc --info to ease debugging of issues like that.
      You're very likely (99%) running Win10 64bit with GnuCOBOL 32bit, which is not necessarily a bad setup btw. But you can only link against 32bit libs/dlls in this case (as I've said: no problem as the system has defined borders, mainly CALL 'SYSTEM'[another executable] and all IPC like socket, named-pipes, message queue, ... and ODBC [so your DB server may be 64bit]).

      Just retry with the x86 setup for esqlOC and you're likely get further.

       
  • celsofigueiredo

    celsofigueiredo - 2020-08-17

    Dear Simon.

    This time it worked, I used it as if it were 32 bits.

    C:\Cobol>SET esqlOC_RUNTIME=C:\esqlOC\win32\release
    
    C:\Cobol>call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
    
    C:\Cobol>cobc -v -x -static -o esqlOCGetStart1.exe -L"%esqlOC_RUNTIME%" -locsql esqlOCGetStart1.cob
    cobc (GnuCOBOL) 3.1-dev.0
    Built     Mar 24 2020 20:55:56  Packaged  Mar 22 2020 20:37:48 UTC
    C version (MinGW) "6.3.0"
    loading standard configuration file 'default.conf'
    command line:   cobc -v -x -static -o esqlOCGetStart1.exe -LC:\esqlOC\win32\release -locsql esqlOCGetStart1.cob
    preprocessing:  esqlOCGetStart1.cob -> C:\Users\Celso\AppData\Local\Temp\cob15236_0.cob
    return status:  0
    parsing:        C:\Users\Celso\AppData\Local\Temp\cob15236_0.cob (esqlOCGetStart1.cob)
    esqlOCGetStart1.cob: in section 'MAIN':
    esqlOCGetStart1.cob:318: warning: ignoring redundant .
    esqlOCGetStart1.cob: in section 'SQLSTATE-CHECK':
    esqlOCGetStart1.cob:337: warning: ignoring redundant .
    return status:  0
    translating:    C:\Users\Celso\AppData\Local\Temp\cob15236_0.cob -> C:\Users\Celso\AppData\Local\Temp\cob15236_0.c (esqlOCGetStart1.cob)
    executing:      gcc -c -I"C:\OpenCobolIDE\GnuCOBOL\include" -o
                    "C:\Users\Celso\AppData\Local\Temp\cob15236_0.o"
                    "C:\Users\Celso\AppData\Local\Temp\cob15236_0.c"
    return status:  0
    executing:      gcc -Wl,--export-all-symbols -Wl,--enable-auto-import
                    -Wl,--enable-auto-image-base -o "esqlOCGetStart1.exe"
                    "C:\Users\Celso\AppData\Local\Temp\cob15236_0.o"
                    -L"C:\OpenCobolIDE\GnuCOBOL\lib" -L"C:\esqlOC\win32\release"
                    -L/mingw/lib -lcob -lm -l"ocsql"
    return status:  0
    
    C:\Cobol>cobc -v -x -static -o esqlOCGetStart1.exe -Q "%esqlOC_RUNTIME%\ocsql.dll" esqlOCGetStart1.cob
    cobc (GnuCOBOL) 3.1-dev.0
    Built     Mar 24 2020 20:55:56  Packaged  Mar 22 2020 20:37:48 UTC
    C version (MinGW) "6.3.0"
    loading standard configuration file 'default.conf'
    command line:   cobc -v -x -static -o esqlOCGetStart1.exe -Q C:\esqlOC\win32\release\ocsql.dll esqlOCGetStart1.cob
    preprocessing:  esqlOCGetStart1.cob -> C:\Users\Celso\AppData\Local\Temp\cob8148_0.cob
    return status:  0
    parsing:        C:\Users\Celso\AppData\Local\Temp\cob8148_0.cob (esqlOCGetStart1.cob)
    esqlOCGetStart1.cob: in section 'MAIN':
    esqlOCGetStart1.cob:318: warning: ignoring redundant .
    esqlOCGetStart1.cob: in section 'SQLSTATE-CHECK':
    esqlOCGetStart1.cob:337: warning: ignoring redundant .
    return status:  0
    translating:    C:\Users\Celso\AppData\Local\Temp\cob8148_0.cob -> C:\Users\Celso\AppData\Local\Temp\cob8148_0.c (esqlOCGetStart1.cob)
    executing:      gcc -c -I"C:\OpenCobolIDE\GnuCOBOL\include" -o
                    "C:\Users\Celso\AppData\Local\Temp\cob8148_0.o"
                    "C:\Users\Celso\AppData\Local\Temp\cob8148_0.c"
    return status:  0
    executing:      gcc -Wl,--export-all-symbols -Wl,--enable-auto-import
                    -Wl,--enable-auto-image-base -o "esqlOCGetStart1.exe"
                    "C:\Users\Celso\AppData\Local\Temp\cob8148_0.o"
                    -L"C:\OpenCobolIDE\GnuCOBOL\lib"
                    C:\esqlOC\win32\release\ocsql.dll -L/mingw/lib -lcob -lm
    return status:  0
    

    But when it came to running the "exe" program, it didn't, it gave an error.

    Celso Henrique.

     
    • Simon Sobisch

      Simon Sobisch - 2020-08-17

      Good to see that the linking works as expected now. Things to do next: add -debug -g to the command line and see if you get any different output with one of those commands.

      And ensure that %esqlOC_RUNTIME% is in %PATH% when running this program.

       
  • celsofigueiredo

    celsofigueiredo - 2020-08-17

    Dear Simon
    It gave the following result with these two compilation directives:

    C:\Cobol>cobc -v -x -debug -g -static -o esqlOCGetStart1.exe -Q "%esqlOC_RUNTIME%\ocsql.dll" esqlOCGetStart1.cob
    cobc (GnuCOBOL) 3.1-dev.0
    Built     Mar 24 2020 20:55:56  Packaged  Mar 22 2020 20:37:48 UTC
    C version (MinGW) "6.3.0"
    loading standard configuration file 'default.conf'
    command line:   cobc -v -x -debug -g -static -o esqlOCGetStart1.exe -Q C:\esqlOC\win32\release\ocsql.dll esqlOCGetStart1.cob
    preprocessing:  esqlOCGetStart1.cob -> esqlOCGetStart1.i
    return status:  0
    parsing:        esqlOCGetStart1.i (esqlOCGetStart1.cob)
    esqlOCGetStart1.cob: in section 'MAIN':
    esqlOCGetStart1.cob:318: warning: ignoring redundant .
    esqlOCGetStart1.cob: in section 'SQLSTATE-CHECK':
    esqlOCGetStart1.cob:337: warning: ignoring redundant .
    return status:  0
    translating:    esqlOCGetStart1.i -> esqlOCGetStart1.c (esqlOCGetStart1.cob)
    executing:      gcc -c -I"C:\OpenCobolIDE\GnuCOBOL\include" -g -o
                    "C:\Users\Celso\AppData\Local\Temp\cob14152_0.o"
                    "esqlOCGetStart1.c"
    return status:  0
    executing:      gcc -Wl,--export-all-symbols -Wl,--enable-auto-import
                    -Wl,--enable-auto-image-base -o "esqlOCGetStart1.exe"
                    "C:\Users\Celso\AppData\Local\Temp\cob14152_0.o"
                    -L"C:\OpenCobolIDE\GnuCOBOL\lib"
                    C:\esqlOC\win32\release\ocsql.dll -L/mingw/lib -lcob -lm
    return status:  0
    
    C:\Cobol>cobc -v -x -debug -g -static -o esqlOCGetStart1.exe -L"%esqlOC_RUNTIME%" -locsql esqlOCGetStart1.cob
    cobc (GnuCOBOL) 3.1-dev.0
    Built     Mar 24 2020 20:55:56  Packaged  Mar 22 2020 20:37:48 UTC
    C version (MinGW) "6.3.0"
    loading standard configuration file 'default.conf'
    command line:   cobc -v -x -debug -g -static -o esqlOCGetStart1.exe -LC:\esqlOC\win32\release -locsql esqlOCGetStart1.cob
    preprocessing:  esqlOCGetStart1.cob -> esqlOCGetStart1.i
    return status:  0
    parsing:        esqlOCGetStart1.i (esqlOCGetStart1.cob)
    esqlOCGetStart1.cob: in section 'MAIN':
    esqlOCGetStart1.cob:318: warning: ignoring redundant .
    esqlOCGetStart1.cob: in section 'SQLSTATE-CHECK':
    esqlOCGetStart1.cob:337: warning: ignoring redundant .
    return status:  0
    translating:    esqlOCGetStart1.i -> esqlOCGetStart1.c (esqlOCGetStart1.cob)
    executing:      gcc -c -I"C:\OpenCobolIDE\GnuCOBOL\include" -g -o
                    "C:\Users\Celso\AppData\Local\Temp\cob2948_0.o"
                    "esqlOCGetStart1.c"
    return status:  0
    executing:      gcc -Wl,--export-all-symbols -Wl,--enable-auto-import
                    -Wl,--enable-auto-image-base -o "esqlOCGetStart1.exe"
                    "C:\Users\Celso\AppData\Local\Temp\cob2948_0.o"
                    -L"C:\OpenCobolIDE\GnuCOBOL\lib" -L"C:\esqlOC\win32\release"
                    -L/mingw/lib -lcob -lm -l"ocsql"
    return status:  0
    

    Celso Henrique

     
    • Simon Sobisch

      Simon Sobisch - 2020-08-17

      So far expected, and the running module?

       
  • celsofigueiredo

    celsofigueiredo - 2020-08-17

    Dear Simon.

    In the directory that I ran this example program, five more files appeared, I will send it to you as attached files.

     
    • Simon Sobisch

      Simon Sobisch - 2020-08-17

      These are the result of -g and needed for debugging in "C" (I think we can jsut ignore those). Do you have %esqlOC_RUNTIME% is in %PATH% when running the program already?
      Is there any change in runtime behaviour with the runtime checks and debugging code you now have activated?

       
  • celsofigueiredo

    celsofigueiredo - 2020-08-17

    Dear Simon

    Do you have %esqlOC_RUNTIME% is in %PATH% when running the program already?
    Yes.

    Celso Henrique

     
  • celsofigueiredo

    celsofigueiredo - 2020-08-17

    Dears.

    As it gave some confusion, in relation to this example, in the question (32 bits or 64 bits). My notbook is 64 bits, for windows 10 and Linux Ubuntu 16.04. I ask: What is the correct link to download the GNUcobol version (64 bits) for Linux Ubuntu and also what is the correct link to download the GNUcobol version (64 bits) for windows 10.

    Celso Henrique.

    P.S.:
    With the help of Simon Sobisch, I managed to compile this example program, I will study some more, because the executable, did not execute correctly, it gave error. I'll try to find out where, maybe it could be an error in connecting to the MYSQL database.

     
<< < 1 2 3 > >> (Page 2 of 3)

Log in to post a comment.