Menu

Help compile GnuCobol

2022-02-26
2022-03-01
  • Husni Ali Husni

    Husni Ali Husni - 2022-02-26

    Anyone, Help me?

    $ make
    make  all-recursive
    make[1]: Entering directory '/c/gnucobol-3.1.2_win'
    Making all in .
    make[2]: Entering directory '/c/gnucobol-3.1.2_win'
    make[2]: Leaving directory '/c/gnucobol-3.1.2_win'
    Making all in lib
    make[2]: Entering directory '/c/gnucobol-3.1.2_win/lib'
    make[2]: Nothing to be done for 'all'.
    make[2]: Leaving directory '/c/gnucobol-3.1.2_win/lib'
    Making all in libcob
    make[2]: Entering directory '/c/gnucobol-3.1.2_win/libcob'
    make[2]: Nothing to be done for 'all'.
    make[2]: Leaving directory '/c/gnucobol-3.1.2_win/libcob'
    Making all in bin
    make[2]: Entering directory '/c/gnucobol-3.1.2_win/bin'
    /bin/sh ../libtool  --tag=CC   --mode=link gcc  -O0 -ggdb3 -fasynchronous-unwind-tables -pipe -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k   -o cobcrun.exe cobcrun.o ../libcob/libcob.la ../lib/libsupport.la -L/mingw64/lib -lintl -R/mingw64/lib
    libtool: link: gcc -O0 -ggdb3 -fasynchronous-unwind-tables -pipe -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k -o .libs/cobcrun.exe cobcrun.o  ../libcob/.libs/libcob.a -LC:/msys64/mingw64/lib -L/mingw64/lib /mingw64/lib/libgmp.dll.a -lxml2 -lz -llzma -liconv -lws2_32 -lpdcurses /mingw64/lib/libvbisam.dll.a ../lib/.libs/libsupport.a -lintl -L/mingw64/lib
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cobcrun.o: in function `cobcrun_split_path_file':
    C:\gnucobol-3.1.2_win\bin/cobcrun.c:174: undefined reference to `__imp_cob_strdup'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:183: undefined reference to `__imp_cob_strdup'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cobcrun.o: in function `cobcrun_initial_module':
    C:\gnucobol-3.1.2_win\bin/cobcrun.c:217: undefined reference to `__imp_cob_setenv'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:219: undefined reference to `__imp_cob_setenv'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:222: undefined reference to `__imp_cob_free'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:233: undefined reference to `__imp_cob_setenv'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:235: undefined reference to `__imp_cob_setenv'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:238: undefined reference to `__imp_cob_free'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cobcrun.o: in function `process_command_line':
    C:\gnucobol-3.1.2_win\bin/cobcrun.c:279: undefined reference to `__imp_cob_optarg'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:287: undefined reference to `__imp_cob_optarg'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:287: undefined reference to `__imp_cob_setenv'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:301: undefined reference to `__imp_print_info_detailed'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:329: undefined reference to `__imp_print_version'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:332: undefined reference to `__imp_print_version_summary'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:340: undefined reference to `__imp_cob_optarg'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:342: undefined reference to `__imp_cob_optarg'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:268: undefined reference to `__imp_cob_getopt_long_long'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cobcrun.o: in function `main':
    C:\gnucobol-3.1.2_win\bin/cobcrun.c:383: undefined reference to `__imp_cob_common_init'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:390: undefined reference to `__imp_cob_init_nomain'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:391: undefined reference to `__imp_print_runtime_conf'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:392: undefined reference to `__imp_cob_stop_run'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:414: undefined reference to `__imp_cob_init_nomain'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:416: undefined reference to `__imp_print_runtime_conf'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:420: undefined reference to `__imp_cob_resolve_cobol'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\gnucobol-3.1.2_win\bin/cobcrun.c:421: undefined reference to `__imp_cob_stop_run'
    collect2.exe: error: ld returned 1 exit status
    make[2]: *** [Makefile:566: cobcrun.exe] Error 1
    make[2]: Leaving directory '/c/gnucobol-3.1.2_win/bin'
    make[1]: *** [Makefile:626: all-recursive] Error 1
    make[1]: Leaving directory '/c/gnucobol-3.1.2_win'
    make: *** [Makefile:534: all] Error 2
    
     

    Last edit: Simon Sobisch 2022-02-26
  • Husni Ali Husni

    Husni Ali Husni - 2022-02-26

    Sorry, Help Build GnuCobol

     
  • Simon Sobisch

    Simon Sobisch - 2022-02-26

    Looks like you build under MSYS2, correct? in This case the MSYS2 suggested way to build a package is to use write a PKGBUILD and use pacman. Otherwise you may need to export some variables - I actually didn't check.
    For building problems

    There is actually an MSYS2 official PKGBUILD file for GnuCOBOL which you can use and adjust as needed - but for GnuCOBOL 3.1.2 that wouldn't even be necessary - as it is officially packaged. pacman -S mingw-w64-i686-gnucobol should install it.

     

    Last edit: Simon Sobisch 2022-09-20
  • Husni Ali Husni

    Husni Ali Husni - 2022-02-28

    Simon!

    I managed to build it using the package provided by the site. It was missing to install the textinfo package.

    Anyway, thank you very much for the information as I was not aware of the package made available through pacman!

    I will also check the package provided in git.

    If you have any support, could you tell me how I can activate a parameter of the runtime.cfg? I needed to change the COB_LS_FIXED!

    Thank you!

     
    • Simon Sobisch

      Simon Sobisch - 2022-02-28

      The package you've installed is intended for being used from "native" Windows, so go with one of:

      • change main runtime config (see cobcrun -r for its path)
      • create a new one (possibly copying the main one as template), thenset COB_RUNTIME_CONFIG=X:\some\app.cfg and adjust that file
      • directly set it: set COB_LS_FIXED=true (or 1 or yes, or ...)
      • directly set it from your COBOL program SET ENVRIONMENT 'COB_LS_FIXED' TO "TRUE"
       
  • Simon Sobisch

    Simon Sobisch - 2022-02-28

    ... and in the case that you only want to use GnuCOBOL from MSYS2 there's a ready to use package at https://www.arnoldtrembley.com/GnuCOBOL.htm#MSYS2 (created from the official pacman package)

     
  • Husni Ali Husni

    Husni Ali Husni - 2022-03-01

    Simon!
    Thank You!

     

Anonymous
Anonymous

Add attachments
Cancel