In your case, it's likely that you don't have wx-config installed.
Issue wx-config --version
in a shell, and if it outputs something, it means that it is installed.
If it's not installed, you'll need to download a package that contains that script, usually called "wx-common".
The package wx-common is installed, wx-config --version says 2.6.1. I've made the settings yop told in the second post of this thread. But it seems that wx-config can not be found. Ouput of the build command:
-------------- Build: default in wxSmith_project ---------------
g++ `wx-config --cflags` wx-config --cflags -I.objs -I- -I.objs -I. -I/usr/include -c app.cpp -o .objs/app.o
g++: wx-config: No such file or directory
cc1plus: note: obsolete option -I- used, please use -iquote instead
cc1plus: error: unrecognized command line option "-fcflags"
Process terminated with status 1 (0 minutes, 2 seconds)
0 errors, 0 warnings
In another Thread (http://forums.codeblocks.org/index.php?topic=2669) you also said
As a note to anyone using RC2, this can be solved as:
Go to Settings->Compiler->Other and set the build mode to "GNU make". Backticks work with it.
But i can not alter these settings as its grayed out. Should i switch away from the nightly build to RC2?
Could you paste the output produced by wx-config --cflags and wx-config --libs in a command line?
Check also if the --cflags outputs the correct include dir.
And, could you paste your project.cbp to see if everything is ok?
wx-config --cflags
andre@main:~$ wx-config --cflags
-I/usr/lib/wx/include/gtk2-unicode-release-2.6 -I/usr/include/wx-2.6 -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA
The Directories are the right ones.
wx-config --libs
andre@main:~$ wx-config --libs
-pthread -lwx_gtk2u_xrc-2.6 -lwx_gtk2u_qa-2.6 -lwx_gtk2u_html-2.6 -lwx_gtk2u_adv-2.6 -lwx_gtk2u_core-2.6 -lwx_baseu_xml-2.6 -lwx_baseu_net-2.6 -lwx_baseu-2.6
The Project file:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="4" />
<Project>
<Option title="wxSmith_project" />
<Option compiler="gcc" />
<Build>
<Target title="default">
<Option output="wxSmith_project" />
<Option type="0" />
<Option compiler="gcc" />
<Option projectResourceIncludeDirsRelation="0" />
</Target>
</Build>
<Compiler>
<Add option="`wx-config --cflags`" />
</Compiler>
<Linker>
<Add option="`wx-config --libs`" />
</Linker>
<Unit filename="app.cpp">
<Option compilerVar="CPP" />
<Option target="default" />
</Unit>
<Unit filename="app.h">
<Option compilerVar="CPP" />
<Option compile="0" />
<Option link="0" />
<Option target="default" />
</Unit>
<Unit filename="mainframe.cpp">
<Option compilerVar="CPP" />
<Option target="default" />
</Unit>
<Unit filename="mainframe.h">
<Option compilerVar="CPP" />
<Option compile="0" />
<Option link="0" />
<Option target="default" />
</Unit>
<Unit filename="wx_pch.h">
<Option compilerVar="CPP" />
<Option link="0" />
<Option weight="0" />
<Option target="default" />
</Unit>
<Unit filename="wxsmith/MainFrame.wxs">
<Option compilerVar="CPP" />
<Option compile="0" />
<Option link="0" />
<Option target="default" />
</Unit>
</Project>
But it still doesn't compile. I loos like it doesn't expand the backsticked part to the shell. Here the last Build Log:
-------------- Build: default in wxSmith_project ---------------
g++ `wx-config --cflags` -I.objs -I- -I.objs -I. -I/usr/include -c wx_pch.h -o .objs/wx_pch.h.gch
cc1plus: note: obsolete option -I- used, please use -iquote instead
wx_pch.h:9:23: error: wx/wxprec.h: No such file or directory
wx_pch.h:16:20: error: wx/wx.h: No such file or directory
Process terminated with status 1 (0 minutes, 1 seconds)
2 errors, 0 warnings
But it still doesn't compile. I loos like it doesn't expand the backsticked part to the shell. Here the last Build Log:
-------------- Build: default in wxSmith_project ---------------
g++ `wx-config --cflags` -I.objs -I- -I.objs -I. -I/usr/include -c wx_pch.h -o .objs/wx_pch.h.gch
cc1plus: note: obsolete option -I- used, please use -iquote instead
wx_pch.h:9:23: error: wx/wxprec.h: No such file or directory
wx_pch.h:16:20: error: wx/wx.h: No such file or directory
Process terminated with status 1 (0 minutes, 1 seconds)
2 errors, 0 warnings
Ok, found your problem. Backticks are expanding correctly, wx-config is working correctly.
The problem is that the precompiled headers are being generated in the object output dir (default). For that to work GCC needs some header paths. But it's more easy to change the precompiled headers strategy.
Just open the project in a text editor and add after <Option title="wxSmith_project" />:
<Option title="wxSmith_project" />
<Option pch_mode="0" />
Or the GUI way: go to menu Project->Properties and in Precompiled headers, change the strategy to Generate PCH in a directory alongside original header.
Generate PCH alongside original header should work too.
Another thing: the warning that appears there cc1plus: note: obsolete option -I- used, please use -iquote instead is being generated by GCC4, which now use -iquote instead of -I-.