Author Topic: compiler args and flags  (Read 5182 times)

Offline maxcy

  • Multiple posting newcomer
  • *
  • Posts: 20
compiler args and flags
« on: September 26, 2023, 03:39:26 am »
 :)  I have a C++ compiler xref project that I got to compile. It uses a filename arg and also needs to use the -x xref flag compiler option. The filename program argument is easy. The compiler flags settings doesn't show any -x options. Maybe going into "other compiler options" and adding -x will do?  From what I know the -x option generates xref info from the compiler as it compiles the source  code. How do I access the xref data that is generated by the compiler with the -x flag set?
maxcy/wt1v

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7592
    • My Best Post
Re: compiler args and flags
« Reply #1 on: September 26, 2023, 03:30:23 pm »
Code::Blocks assumes an two stage build method is used.

1. Stage one creates object file(s)
2. Stage two uses the object file(s) to create an output file

Linker options are used in stage two
Compiler options are used in stage one

Is the option you wish to add an linker or compiler option?
Try adding the option to the project/target other options for the correct stage.

Edit2: Link I post for adding non C/C++ support it might help if you have no knowledge of advanced compiler settings area https://wiki.codeblocks.org/index.php/Adding_support_for_non_C/C%2B%2B_files_to_the_build_system

Tim S.
« Last Edit: September 26, 2023, 03:36:11 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline maxcy

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: compiler args and flags
« Reply #2 on: September 27, 2023, 03:26:29 am »
Rather embarrassing! I put the -x compiler parameter after the first argument and all was well! :o