Menu

cobol with cygwin and mingw compiler

2020-10-25
2020-10-25
  • alien with special powers

    Hi all-

    I am trying to get with the people that are using the mingw tools.

    If you stay within the cygwin environment with gcc you are fine but i have no idea how to deploy the app because of the dir and file permissions.

    I am trying to compile gnucobol with mingw.

    I used the following variables:

    CC, CXX, LD_LIBRARY_PATH, and of course set the paths to the binaries in windows.

    I cd into the source directory and execute mkdir build.

    Then, I cd into the build dir.

    Then run this:
    $ ../configure --prefix=/home/user/cobol-3.1-rc1 --host=x86_64-w64-mingw32

    after I run make my outputs look like this:

    configure: GnuCOBOL Configuration:
    configure:  CC                x86_64-w64-mingw32-gcc.exe
    configure:  CFLAGS            -O2 -pipe -finline-functions -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k -U_FORTIFY_SOURCE
    configure:  LDFLAGS
    configure:  PROGRAMS_LIBS         -lintl
    configure:  COB_CC            x86_64-w64-mingw32-gcc.exe
    configure:  COB_CFLAGS        -I/home/user/cobol-3.1-rc1/include -Wno-unused -fsigned-char -Wno-pointer-sign -pipe
    configure:  COB_LDFLAGS
    configure:  COB_LIBS          -L${exec_prefix}/lib -lcob -lm
    configure:  COB_CONFIG_DIR    ${datarootdir}/gnucobol/config
    configure:  COB_COPY_DIR      ${datarootdir}/gnucobol/copy
    configure:  COB_LIBRARY_PATH  ${exec_prefix}/lib/gnucobol
    configure:  COB_OBJECT_EXT    o
    configure:  COB_MODULE_EXT    dll
    configure:  COB_EXE_EXT       .exe
    configure:  COB_SHARED_OPT    -shared
    configure:  COB_PIC_FLAGS     -DDLL_EXPORT -DPIC
    configure:  COB_EXPORT_DYN    -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-auto-image-base
    configure:  COB_STRIP_CMD     x86_64-w64-mingw32-strip --strip-unneeded
    configure:  Dynamic loading:                             System
    configure:  Use gettext for international messages:      yes
    configure:  Use fcntl for file locking:                  no
    configure:  Use math multiple precision library:         gmp
    configure:  Use curses library for screen I/O:           ncursesw
    configure:  Use Berkeley DB for ISAM I/O:                yes
    configure:  Use libxml2 for XML I/O:                     no
    configure:  Use cJSON for JSON I/O:                      no
    

    The the make section where I get the error looks like this:

    make[2]: Entering directory '/home/user/gnucobol-3.1-rc1_win/build/extras'
    ("../pre-inst-env" cobc.exe -m -Wall -O2 -o "CBL_OC_DUMP.dll" "../../extras/CBL_OC_DUMP.cob" || \
     "../pre-inst-env" cobc.exe -m -Wall     -o "CBL_OC_DUMP.dll" "../../extras/CBL_OC_DUMP.cob" || \
     "../pre-inst-env" cobc.exe -m -Wall -vv -o "CBL_OC_DUMP.dll" "../../extras/CBL_OC_DUMP.cob")
    configuration error:
    default.conf: No such file or directory
    configuration error:
    default.conf: No such file or directory
    cobc (GnuCOBOL) 3.1-rc1.0
    Built     Oct 25 2020 03:01:01  Packaged  Jul 01 2020 00:39:30 UTC
    C version (MinGW) "9.2.0"
    loading standard configuration file 'default.conf'
    configuration error:
    default.conf: No such file or directory
    make[2]: *** [Makefile:608: CBL_OC_DUMP.dll] Error 1
    make[2]: Leaving directory '/home/user/gnucobol-3.1-rc1_win/build/extras'
    make[1]: *** [Makefile:627: all-recursive] Error 1
    make[1]: Leaving directory '/home/user/gnucobol-3.1-rc1_win/build'
    make: *** [Makefile:535: all] Error 2
    

    Just put a default.conf in the directory whenever it complains.

    When I tested the helloworld.exe outside of the cygwin environment it complained so I gave it the default.conf in the .exe directory.

    Thanks,
    roboloki

     

    Last edit: alien with special powers 2020-10-25
  • alien with special powers

    Hi all-

    I just got agar to run in addition to cobol with cygwin and mingw. I thought it would be more useful to leave an agar summary.

    You have to follow Agar instructions under docs on their website.

    It would be helpful to set CC, CXX, MINGWROOT (You could set that in control panel too).

    Also, you need all the usual MINGW paths set in windows.

    WARNING: i fell asleep at the wheel and accepted the agar prefix on the libagar site. Only do that if you don't care if agar is not contained in its own place. There is no make uninstall.

    In environment variablles-
    For path, I used :

    C:\cygwin\usr\x86_64-w64-mingw32\sys-root\mingw\bin
    C:\cygwin\usr\x86_64-w64-mingw32\bin
    C:\cygwin\bin

    for LD_LBRARY_PATH, i USED:

    C:\cygwin\usr\x86_64-w64-mingw32\sys-root\mingw\lib

    ./configure --host=x86_64-w64-mingw32 --prefix=$MINGWROOT --enable-debug --with-{freetype,sdl,png,jpeg,gl}=$MINGWROOT --without-{fontconfig,gettext,iconv} --enable-static

    Make sure you close out of (in my case mintty) shell and restart the shell for the path variables you set in windows control panel to take effect.

     x86_64-w64-mingw32-gcc -o hello  -IC:/cygwin/usr/x86_64-w64-mingw32/sys-root/mingw/include/agar `$MINGWROOT/bin/agar-config --cflags` ./hello.c  `$MINGWROOT/bin/agar-config --libs`
    

    thanks,
    roboloki

     

    Last edit: alien with special powers 2020-10-25

Anonymous
Anonymous

Add attachments
Cancel