User forums > Using Code::Blocks
How to see the generated compiler parameters?
cacb:
I am compiling a few Code::Blocks projects with wxWidgets, using wx-config. I have a configuration issue on Linux and need to see what exactly Code::Blocks is saying to the compiler, i.e. the compiler and linker command line parameters.
Where can I find the fully expanded cimpiler parameters?
oBFusCATed:
Read here: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
cacb:
--- Quote from: oBFusCATed on April 03, 2011, 08:26:04 pm ---Read here: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
--- End quote ---
Thank you, that gave me exactly what I was looking for! :D I can see the options generated now.
The problem I trying to solve is that I don't seem to have 100% control over which wx-config I am using in Linux build targets, thereby leaving a big 'hole' in the configuration of Code::Blocks projects using wxWidgets. My projects have compiler settings like this
--- Code: ---<Compiler>
<Add option="-Wall" />
<Add option="-g" />
<Add option="`wx-config --version=2.8 --toolkit=gtk2 --debug --cxxflags`" />
<Add option="`wx-config --cflags`" />
<Add option="-DNOPCH" />
<Add option="-D__WXDEBUG__" />
<Add option="-D_DEBUG" />
<Add option="-D__WX__" />
</Compiler>
--- End code ---
As I have a locally compiled version of wxWidgets (using static libraries, among other things), I was trying to tell Code::Blocks to use the wx-config found in /usr/local/bin by means of the Code::Blocks global variable "wx" (defined as /usr/local):
--- Code: ---<Compiler>
<Add option="-Wall" />
<Add option="-g" />
<Add option="`$(#wx)/bin/wx-config --version=2.8 --toolkit=gtk2 --debug --cxxflags`" />
<Add option="`$(#wx)/bin/wx-config --cflags`" />
<Add option="-DNOPCH" />
<Add option="-D__WXDEBUG__" />
<Add option="-D_DEBUG" />
<Add option="-D__WX__" />
</Compiler>
--- End code ---
However, this didn't work, as it now becomes clear that Code::Blocks global variables don't get expanded in the context of "backticks". So instead I had to manually expand it to
--- Code: ---<Compiler>
<Add option="-Wall" />
<Add option="-g" />
<Add option="`/usr/local/bin/wx-config --version=2.8 --toolkit=gtk2 --debug --cxxflags`" />
<Add option="`/usr/local/bin/wx-config --cflags`" />
<Add option="-DNOPCH" />
<Add option="-D__WXDEBUG__" />
<Add option="-D_DEBUG" />
<Add option="-D__WX__" />
</Compiler>
--- End code ---
Which isn't 100% general, as I would like everything to be dependent in the wx global variable. Any tips on how to achive it is welcome.
But you answered my original question, so thanks for that :D
oBFusCATed:
Add /usr/local/bin to your PATH, you can probably use the envvar plugin.
I think there is a way to combine all wx-config scripts in one, but I don't know how.
Probably you should ask the wx guys.
p.s. you should remove the `wx-config --cflags`
cacb:
--- Quote from: oBFusCATed on April 03, 2011, 09:18:08 pm ---Add /usr/local/bin to your PATH, you can probably use the envvar plugin.
I think there is a way to combine all wx-config scripts in one, but I don't know how.
Probably you should ask the wx guys.
--- End quote ---
I see, but the idea was to keep as much configuration as possible in the .cbp file. If you share the project file with others it is important. But it is a good idea to learn more about wx-config from the wx guys.
--- Quote from: oBFusCATed on April 03, 2011, 09:18:08 pm ---p.s. you should remove the `wx-config --cflags`
--- End quote ---
Aha. Thanks.
Navigation
[0] Message Index
[#] Next page
Go to full version