Menu

IGNORE I MADE SOME PROGRESS THANKS...Fw: [gnucobol:discussion] Fw: [gnucobol:discussion] gix gix-sql build help <additional info>

J McNamara
2024-12-06
2024-12-07
  • J McNamara

    J McNamara - 2024-12-06

    Sent with Proton Mail secure email.

    ------- Forwarded Message -------
    From: J McNamara masticon@users.sourceforge.net
    Date: On Friday, December 6th, 2024 at 5:03 PM
    Subject: [gnucobol:discussion] Fw: [gnucobol:discussion] gix gix-sql build help
    To: [gnucobol:discussion] help@discussion.gnucobol.p.re.sourceforge.net

    -g -O0 -c -std=c99
    -lmingw32 -lfmt -lgixsql -lgnucobol -lm -lgcc -lstdc++ -lspdlog

    Sent with Proton Mail secure email.

    thanks
    ------- Forwarded Message -------
    From: J McNamara masticon@users.sourceforge.net
    Date: On Friday, December 6th, 2024 at 4:47 PM
    Subject: [gnucobol:discussion] gix gix-sql build help
    To: [gnucobol:discussion] help@discussion.gnucobol.p.re.sourceforge.net

    Hi-

    Build time for BuildActionPreprocessESQLHandler: 154ms
    Building C:/Users/stealth_droid/Documents/Gix/Examples/test001/bin/debug/x64/TEST001.o
    BuildingC:/Users/stealth_droid/Documents/Gix/Examples/test001/bin/debug/x64/TEST001.cbsql
    Using compiler C:/msys64/mingw64/bin/cobc.exe
    C:/msys64/mingw64/bin/cobc.exe -std default -g -debug -O0 --fgen-c-line-directives --fgen-c-labels -A -O0 -gdwarf-4 -I C:/Users/stealth_droid/Documents/Gix/Examples/test001 -I C:/Users/stealth_droid/AppData/Local/Programs/Gix-IDE/lib/copy -I C:/Users/stealth_droid/AppData/Local/Programs/Gix-IDE/lib/copy -lmingw32 -lfmt -lgixsql -lgnucobol -lm -lgcc -lstdc++ -lspdlog -t --tsymbols -v -x -c -o C:/Users/stealth_droid/Documents/Gix/Examples/test001/bin/debug/x64/TEST001.o C:/Users/stealth_droid/Documents/Gix/Examples/test001/bin/debug/x64/TEST001.cbsql
    cobc: error: -o option invalid in this combination

    cobc (GnuCOBOL) 3.2.0
    Built Nov 27 2024 17:43:47 Packaged Jul 28 2023 17:02:56 UTC
    C version (MinGW) "14.2.0"

    Build error
    Exit code: 1
    An error occurred while handling target C:/Users/stealth_droid/Documents/Gix/Examples/test001/bin/debug/x64/TEST001.o
    An error occurred while handling target C:/Users/stealth_droid/Documents/Gix/Examples/test001/bin/debug/x64/TEST001.exe
    Build error

    Hi -

    I think it is telling me don't use both -x and -c together in one step is that correct?
    Is there a way i can fix in the gui for gix ide?
    I just understand things like compile to produce o and then link etc.
    I don't know this very well admittedly.

    thanks

    Sent with Proton Mail secure email.


    gix gix-sql build help


    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/gnucobol/discussion/help/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/


    Fw: [gnucobol:discussion] gix gix-sql build help <additional info=""></additional>


    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/gnucobol/discussion/help/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

     
    • Simon Sobisch

      Simon Sobisch - 2024-12-07

      ... and the progress is?

       
  • Anonymous

    Anonymous - 2024-12-07

    Hi simon,

    below is a post that shows that i was dead stuck trying to use the command line to do anything in this project because of an error i had and it definitely impeded me. The solutioin was revealed by chatgpt. I had tried to adjust with cobcenv.cmd but didnt get it to work that way, but this seemed to be a partial work around for default.conf location. I hope you dont get mad that i cross posted between here and github issues but i closed out that ticket, and just wanted to report back something positive. Here is an outline of the resolution of an error that happens to gnucobol people and one such partial solution. thanks....

    It seems like the issue persists with the path format, specifically with the COB_CONFIG_DIR environment variable still being set incorrectly. The error message suggests that cobc is unable to find the configuration file default.conf because the path is being interpreted as C:\msys64\share\gnucobol\config instead of the Unix-style path /mingw64/share/gnucobol/config.

    Issue Recap:
    The path format: The COB_CONFIG_DIR is expected to be in Unix-style (/mingw64/share/gnucobol/config), but it is still being treated as a Windows-style path (C:\msys64\share\gnucobol\config).
    The setx command: It doesn't handle Unix-style paths properly, leading to incorrect path assignments in the environment.
    Plan:
    Avoid using setx: As mentioned earlier, setx is not suitable for setting Unix-style paths. MSYS2 requires environment variables to be set using export in shell configuration files like .bashrc.
    Use cygpath correctly to ensure the conversion of the path format works as expected.
    Fix:
    To directly address this, we will ensure the path is converted properly and set the environment variable for the current session. This avoids using setx for MSYS2 and uses the correct Unix path format.

    Solution:
    Manually set the COB_CONFIG_DIR using cygpath in the MSYS2 shell and avoid the setx command.
    Ensure the ~/.bashrc file contains the proper export statement for future sessions.
    Step-by-Step Solution:
    Step 1: Set the Environment Variable for the Current Session
    Instead of using setx (which is for Windows), we can use the export command directly in the MSYS2 shell to set the environment variable.

    Run this in your MSYS2 shell (or place it in your .bashrc):

    bash
    Copy code
    export COB_CONFIG_DIR=$(cygpath -u "C:\msys64\share\gnucobol\config")
    This will convert the Windows path to a Unix-style path and set COB_CONFIG_DIR for the current session.

    Step 2: Update ~/.bashrc for Future Sessions
    To ensure that COB_CONFIG_DIR is set correctly for future sessions, we need to modify your ~/.bashrc file. You can manually edit the file or append the following line to it:

    bash
    Copy code
    echo 'export COB_CONFIG_DIR=$(cygpath -u "C:\msys64\share\gnucobol\config")' >> ~/.bashrc
    This will ensure that every time you start a new MSYS2 shell, the COB_CONFIG_DIR variable will be set correctly.

    Step 3: Test the Environment Variable
    Source the ~/.bashrc or restart the MSYS2 shell to load the new configuration:

    bash
    Copy code
    source ~/.bashrc
    Check the environment variable:

    bash
    Copy code
    echo $COB_CONFIG_DIR
    This should return:

    bash
    Copy code
    /mingw64/share/gnucobol/config
    Step 4: Re-run the cobc Command
    Now, try running the cobc command again to see if it works:

    bash
    Copy code
    /mingw64/bin/cobc -c TEST1001.cbl
    Explanation:
    Using cygpath: The cygpath -u command converts the Windows path (C:\msys64\share\gnucobol\config) into a Unix-style path (/mingw64/share/gnucobol/config).
    Using export: This command sets the environment variable for the current shell session, ensuring that MSYS2 tools can find the configuration directory.
    ~/.bashrc: This is where environment variables should be stored for persistent changes in MSYS2, so adding the export command here ensures that it will be set each time you start a new shell.
    Conclusion:
    By setting the environment variable COB_CONFIG_DIR using export with cygpath, you ensure that the path is converted correctly for MSYS2 tools, and they will be able to find the default.conf configuration file. This should resolve the error you were encountering. Let me know if this works or if you encounter further issues!

    THE CHATGPT TOLD ME HOW TO GET PAST USING THE COMMAND LINE WHERE I RAN INT O THE ERROR MESSAGE
    configuration error:
    /mingw64/share/gnucobol/config\default.conf: No such file or directory

    SO NOW I CAN FOCUS ON HOW TO GET THIS THING TO COMPILE MAYBE ON THE COMMAND LINE AND PREPROCESS AND THEN WORRY ABOUT THE IDE. OR SOME SUCH. I HAVE A LOT OF WORK TO DO. SORRY. THANKS. JIM

     

Anonymous
Anonymous

Add attachments
Cancel