Search code examples
visual-studio-codegnucobol

How to fix vscode GnuCOBOL setup "configuration error: default.conf: No such file or directory"


vscode error message

we are using cobol now, but this config error keeps on appearing and I do not know how to fix this thing. Any help would really mean alot. (Just a beginner and trying to learn vscode)


Solution

  • Late, but perhaps worth it. Currently there is a cobenv.bat or .sh (if you are on linux). The whole path to the file may differ for me is this:

    C:\msys64\mingw64\bin\cobenv.cmd
    

    You'll notice that if you execute the file and run the compiler everything works fine, but once you close that bash the error shows up again.

    That's because the scope of those variables was just that session. You may execute it every time you run the compiler or you can make those variables to persist on your system. In my case I did the later, modifying cobenv.cmd

    But not those lines with the variable PATH.

    So this lines, i.e., whenever we encounter this same three variables. For instance, after a certain if in that file we encounter:

      setx "COB_LIBRARY_PATH" "%MINGW_ROOT_PATH%lib\gnucobol%COB_LIBRARY_PATH%"
      setx "COB_COPY_DIR" "%MINGW_ROOT_PATH%share\gnucobol\copy"
      setx "COB_CONFIG_DIR" "%MINGW_ROOT_PATH%share\gnucobol\config"
    

    Default value: set.

    New value: setx.

    Delete the = to comply with the correct syntax. Check the compiler with different new session.