Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: maxcy on September 26, 2023, 03:39:26 am

Title: compiler args and flags
Post by: maxcy 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
Title: Re: compiler args and flags
Post by: stahta01 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 (https://wiki.codeblocks.org/index.php/Adding_support_for_non_C/C%2B%2B_files_to_the_build_system)

Tim S.
Title: Re: compiler args and flags
Post by: maxcy 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