Menu

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

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

    J McNamara - 2024-12-06

    -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/

     
    • J McNamara

      J McNamara - 2024-12-06

      i got this off chatgpt .

      I guess i was way off.

      I will work on what it tells me.

      thanks

      Possible Error Scenario:

      If you include linking flags (like -lgixsql, -lgnucobol) while using -c, it may confuse the build system and cause errors like "extra -o error," because the compiler will expect to link them at the end, but you’ve told it not to do so with -c.

      Example of what might be wrong:

      bash

      Copy code

      gcc -g -O0 -c -std=c99 mysource.c -o mysource.o -lgixsql -lgnucobol

      • -c: Compile only to mysource.o (no linking).
      • -lgixsql and -lgnucobol: These are linking flags, but you’re not actually linking anything since you used -c.

      This would likely trigger errors because the linking flags (-lgixsql, etc.) don’t make sense when you’re only compiling (not linking). The linker will not be involved at all during the -c step.

      Correcting the Command:

      You should separate the compilation and linking steps. For example:

      1. Compilation (with -c to generate object files):

      bash

      Copy code

      gcc -g -O0 -c -std=c99 mysource.c -o mysource.o

      1. Linking (creating the executable):

      bash

      Copy code

      gcc -o myprogram mysource.o -lgixsql -lgnucobol -lm -lgcc -lstdc++ -lspdlog

      This way, you’re:

      • Compiling the source file into an object file (-c).
      • Linking the object file into a final executable, including any required libraries (using -o and -l flags for linking).

      Conclusion:

      • If you're only compiling (with -c), don’t include linking flags (-l<lib> or -o <output_file>) in the same command.</output_file></lib>
      • Use -o to specify the object file name when compiling (e.g., -o mysource.o).
      • After compilation, use a separate command for linking, where you can specify the executable output file and link libraries.

      In summary:

      • For compilation (with -c):

      bash

      Copy code

      gcc -g -O0 -c -std=c99 mysource.c -o mysource.o

      • For linking (after compilation):

      bash

      Copy code

      gcc -o myprogram mysource.o -lgixsql -lgnucobol -lm -lgcc -lstdc++ -lspdlog

      Let me know if this clears things up or if you encounter further issues!

      Sent with Proton Mail secure email.

      ------- Forwarded Message -------
      From: Jim McNamara jmcnamara10001@proton.me
      Date: On Friday, December 6th, 2024 at 5:02 PM
      Subject: 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/

       

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.