Menu

Encountering an Error whole Making the File: "make: *** [all] Error 2"

Anonymous
2022-05-03
2022-05-07
  • Anonymous

    Anonymous - 2022-05-03

    Hello, I am a newcomer to using shells, open-source code, and cobol. I recently became interested in COBOL so I decided to get the latest version of GNUCobol(3.1.2) from the big green button for my 64-bit Windows 10 device. I already had MinGW installed, and ran up MinGW\msys\1.0\msys.bat from my cmd terminal. Then, using the opened shell I performed ./configure, but the terminal thre up something about BerkeleyDB, but luckily this thread here gave me the solution of just running "./configure --without-db", which started off well enough, until I then performed "make". I can't provide all of what the terminal gave out due to privacy conerns, but here's some important snippets that may be useful:

    From earlier on:

    intrinsic.c:6387:3: warning: 'strncpy' output may be truncated copying 25 bytes from a string of length 36 [-Wstringop-truncation]
     6387 |   strncpy (time_format_str, datetime_format_str, COB_TIMESTR_MAX);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    intrinsic.c:6385:3: warning: 'strncpy' output may be truncated copying 10 bytes from a string of length 36 [-Wstringop-truncation]
     6385 |   strncpy (date_format_str, datetime_format_str, COB_DATESTR_MAX);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    intrinsic.c:6393:3: warning: 'strncpy' output may be truncated copying 10 bytes from a string of length 36 [-Wstringop-truncation]
     6393 |   strncpy (formatted_date, formatted_datetime, COB_DATESTR_MAX);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    

    Later:

    ./.libs/lt-cobcrun.c:163:35: error: expected ',' or ';' before 'c'
      163 | const char * LIB_PATH_VALUE   = ""c:\\Users\\My Name\\gnucobol-3.1.2_win\\libcob\\.libs";";
          |
    

    This one repeated itself a lot, have no idea why the clashes repeated in the first place.

    cobc.c:7026:7: warning: 'strncat' output may be truncated copying between 0 and 1025 bytes from a string of length 1025 [-Wstringop-truncation]
     7026 |       strncat (newline, ttoken, ttlen);
          |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    codegen.c:4497:32: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
     4497 |    output ("memcpy (b_ptr + %6lu, b_ptr, %6lu);", len, len);
          |                             ~~~^                  ~~~
          |                                |                  |
          |                                long unsigned int  size_t {aka unsigned int}
          |                             %6u
    codegen.c:4497:45: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
     4497 |    output ("memcpy (b_ptr + %6lu, b_ptr, %6lu);", len, len);
          |                                          ~~~^          ~~~
          |                                             |          |
          |                                             |          size_t {aka unsigned int}
          |                                             long unsigned int
          |                                          %6u
    codegen.c:4507:32: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
     4507 |    output ("memcpy (b_ptr + %6lu, b_ptr, %6lu);",
          |                             ~~~^
          |                                |
          |                                long unsigned int
          |                             %6u
     4508 |     len, (long)f->size * (occ - j));
          |     ~~~
          |     |
          |     size_t {aka unsigned int}
    

    And finally:

    make[2]: *** [CBL_OC_DUMP.dll] Error 127
    make[2]: Leaving directory `/c/Users/My Name/gnucobol-3.1.2_win/extras'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/c/Users/My Name/gnucobol-3.1.2_win'
    make: *** [all] Error 2
    

    Frankly, I have no idea what is happening here so I would appreaciate any and all insight into this problem. If there is a past thread that could help me, please link it.

    Thanks,
    TriAttack

     
  • Simon Sobisch

    Simon Sobisch - 2022-05-03

    Hi TriAttack and welcome to the world of free software, shells, GnuCOBOL and COBOL.

    There are more warnings than I'd expect on a "plain MSYS" environment, but when up-to-date that likely is a "match".

    In general those warnings are just warnings, you can ignore those for now.
    The lt-cobcrun.c thing is a hard error, and one I haven't seen before. I guess there are spaces and/or special characters in those path definitions, correct?

    To ease the building you possibly want to run the process in a folder like "C:\Dev\GnuCOBOL" or similar, I guess that this will bring your build through and also allows to runmake check (and depending if you have perl installed also make test).

    Building GnuCOBOL yourself is never wrong, but commonly only needed if you want to be sure to be able to adjust and inspect it at any time. While I still want to challenge you to go on (at least a bit) you may also go with getting the binaries; the official binary packages are found at https://www.arnoldtrembley.com/GnuCOBOL.htm and "nightly builds" with MinGW 32bit (and a bit outdated components) are also available, see https://sourceforge.net/projects/gnucobol/files/gnucobol/nightly_snapshots/.

    Note: you may want to register/login, otherwise there's a manual moderation que to get posts shown - and it is always nice to be able to "recognize" people.

     
  • Simon Sobisch

    Simon Sobisch - 2022-05-03

    ... and nearly forgot: there is a good "Build Guide for MinGW GnuCOBOL" in both .pdf and .odt on Arnold's page, too.

     
  • Anonymous

    Anonymous - 2022-05-07

    Thank you for the warm welcome! I honestly had no idea that I could just download the binary, but I think I'm going to give a manual build just one more try. You are spot on with one of the folder names-Window's "Program Files" directory has a space in it, which may have messed up the process. I'll return with my results.

     
  • Anonymous

    Anonymous - 2022-05-07

    Alright, make worked but make check now says this:
    ERROR: 1036 tests were run,
    28 failed (22 expected failures).
    50 tests were skipped.

    Scrolling through the text, it seems that the following tests threw unexpected errors:
    8,19,20,21,23,771

    What should I do? Should I download a new version?

     
  • Anonymous

    Anonymous - 2022-05-07

    Ok, I successfully extracted the binary and followed the ending steps of the pdf guide, but windows still does not recognize cobc as a command.

     
  • Anonymous

    Anonymous - 2022-05-07

    Nevermind, it works now, just need to put a space before entering cobc. Thanks for all the help!

     
  • TriAttack

    TriAttack - 2022-05-07

    Ok, after some tinkering and messing with environment variables I finally have cobc up and running. Thanks again for all the help. Now I have to go get my hands dirty with COBOL!

     

Anonymous
Anonymous

Add attachments
Cancel