After further investigations, it seems that CodeBlocks use the right location to display the declarations, but the compiler use an other one.
I inserted some syntax errors in the headers of wx2.9. The compiler was always happy, but codeblocks shown me the changes in the files.
As soon i changed the header of 2.8, the compiler detected the error.
In my Projetc->Build options for the whole project ( not for debug nor release ) i have in "search diretories":/usr/locale/include/wx-2.9
in my Project->Compiler settings->other options i have `wx-config --cflags`
and wx-config -cflags gives
~$ wx-config --cflags
-I/usr/local/lib/wx/include/gtk2-unicode-static-2.9 -I/usr/local/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -pthread
and my files are indeed in /usr/local/include/wx-2.9
I don't understand where the includes of wx2.8 used by the compiler are coming from.
What did i made wrong ?
Thanks.
if i look in the log window i have:
g++ -Wall -DWX_PRECOMP -g -pg -g -Wunused-variable -Wno-deprecated -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I/usr/include/mysql -c /home/moi/aMule-SVN-r10490/MyAmulePrj/wx_pch.h -o wx_pch.h.gch/Debug_wx_pch_h_gch
g++ -Wall -DWX_PRECOMP -g -pg -g -Wunused-variable -Wno-deprecated -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I/usr/include/mysql -c /home/moi/aMule-SVN-r10490/MyAmulePrj/GUIFrame.cpp -o obj/Debug/GUIFrame.o
No wx2.9
in the build options of the project, compiler->other options : nothing
linker settings : all empty
search directories : all empty
all options specific to the project are empty exept WX_PRECOMP
in the global settings , my other optons of the compiler are:
Wunused-variable
-Wno-deprecated
`wx-config --cflags`
in search direct. i: /usr/include/mysql
if I change the global setting wx-config to wxKonfig the log change to this
g++ -Wall -DWX_PRECOMP -O2 -pg -g -Wunused-variable -Wno-deprecated -I/usr/include/mysql -c /home/moi/aMule-SVN-r10490/MyAmulePrj/wx_pch.h -o wx_pch.h.gch/Release_wx_pch_h_gch
wx-Konfig is unknown so wx-config in the global settings is the command actually executed.
But, under CodeBlocks wc-config gives : -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8
and in a console it gives : -I/usr/local/lib/wx/include/gtk2-unicode-static-2.9 -I/usr/local/include/wx-2.9
In settings, neither for global nor project i have nothing relating to wx2.8, except in Header fixup configuration where i have all headers files for wx2.8 and 2.6 but they are only filemanes, without path.
if insteed of wx-config --cflagfs i type wx-config --version=2.9 -cflags , command is not executed, i have no include in the compiler command line.
I have no environment variables defined.
Should I ?
thank
I already tried to add --version=2.9 like this wx-config -cflags --version=2.9. Codeblocks don't accept it but it works in a console. With version=2.8, same result.
:~$ wx-config --list
Default config is gtk2-unicode-static-2.9
Default config will be used for output
Alternate matches:
gtk2-unicode-2.9
Also available in /usr/local:
gtk2-ansi-debug-2.8
gtk2-ansi-debug-2.9
gtk2-ansi-release-2.8
gtk2-ansi-release-2.9
gtk2-unicode-debug-2.9
gtk2-unicode-release-2.8
gtk2-unicode-release-2.9
in console, env gives a lot of things with noting to do with widgets.
I don't understand this
create a symlink to /usr/local/lib/wx/config/gtk2-unicode-release-static-2.9
I have no problem to link, i just can't compile with the good headers. and anyway, i usually add the libs in the buils options.
I noticed somethng else:
wx-config in console returns /usr/locale/include/.....
but in codeblocks log i have /usr/include.....
see my previous post
and in fact, if i rename /usr/include/wx-2.8 to wx2.8a codeblocks don't find any header.
And something strange too in my log.
g++ -Wall -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -g -pg -g -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -Wunused-variable -Wno-deprecated -I/usr/local/include/wx-2.9 -I/usr/include/mysql -c /home/moi/aMule-SVN-r10490/MyAmulePrj/GUIFrame.cpp -o obj/Debug/GUIFrame.o
cc1plus: warning: ./wx_pch.h.gch/Release_wx_pch_h_gch: not used because `__OPTIMIZE__' not defined
In file included from /usr/local/include/wx-2.9/wx/platform.h:711,
from /usr/local/include/wx-2.9/wx/defs.h:26,
from /usr/local/include/wx-2.9/wx/wx.h:15,
from /home/moi/aMule-SVN-r10490/MyAmulePrj/GUIFrame.h:19,
from /home/moi/aMule-SVN-r10490/MyAmulePrj/GUIFrame.cpp:19:
/usr/local/include/wx-2.9/wx/chkconf.h:94:9: error: #error "wxUSE_ANY must be defined, please read comment near the top of this file."
/usr/local/include/wx-2.9/wx/chkconf.h:102:9: error: #error "wxUSE_CONSOLE_EVENTLOOP must be defined, please read comment near the top of this file."
../.. and so on
As you can see, it seem that wx-config is called AFTER something else as i have include path of wx2.9 ( result of wx-config) after wx2.8.
what i made now: i made a small bath called sdcc installed in the right directory. Of course i don't have this compiler ( sdcc ).
This batch is just :
echo param for icc==>
because at first i wanted to do it for icc ...
and now my log is
sdcc -Wall -I/usr/local/lib/wx/include/gtk2-unicode-static-2.9 -I/usr/local/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -pthread -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -g -I/usr/local/include/wx-2.9 -c GUIFrame.cpp -o obj/Debug/GUIFrame.o
param for icc==>
sdcc -Wall -I/usr/local/lib/wx/include/gtk2-unicode-static-2.9 -I/usr/local/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -pthread -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -g -I/usr/local/include/wx-2.9 -c MyAmulePrjApp.cpp -o obj/Debug/MyAmulePrjApp.o
param for icc==>
I don't have any wx-2.8 in the path. It seem's i have a something defined for g++, called previously to wx-config and "hidden".
Now back to g++. If i erase every wx-config or additionnal search path for global or project setting ( what a mess) , the log still show a call to wx-2.8.
i removed all the headers of my project and the precomp headers=> same thing wx-2.8 still there
As i told you, i still have in Settings->Environement>Header-fixup configuration ( see attachment ) a lot of stuff about the old versions of widgets ( 2.8, 2.6 ) and codeblocks.
I wonder if it can't have something to see with.
reg.
Do you have anything set in "Settings -> Compiler and debugger -> Global compler settings -> [the compiler you use]" ?
Especially in "Search directories" an other compiler/linker options ?
Try wx-config with additional parameter --prefix=/usr/local:
wx-config --prefix=/usr/local --version=2.9 --unicode --cxxflags
hi,
Back again.
After some investigations it seems to work.
Maybe could it be useful for others.
on my system I have several wx-config installed.
one in /usr/local/bin & another one in /usr/bin
if I run
:/$ /usr/bin/wx-config --cxxflags
-I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread
and 2nd location
/$ /usr/local/bin/wx-config --cxxflags
-I/usr/local/lib/wx/include/gtk2-unicode-static-2.9 -I/usr/local/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -pthread
and my path is:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
And it seems to be the problem:
When I enter run wx-config with no path, in a terminal, i use my system path, and the first found is /usr/local/bin , and wx-config returns the right lib 2.9.
But CodeBlocks seems to "spawn" wx-config with another path, /usr/bin i guess, and it return the wrong lib 2.8.
MAybe is there a parameter somewhere in CB to define a path for the shell, but i don't know where.
I changed the path of the compiler/linker but no change.
For me it's solved.