User forums > Using Code::Blocks
Codeblocks compile errs on 1889
killerbot:
how about doing the simple thing :
add include of <wx/dir.h> in configmanager.cpp (like always).
Basic rule : include what you need, don't depend on others (other header files) including it for you, in that way it is more obvious and visible to the programmer also. It seems it is also included ifndef CB_PRECOMP.
I am not so up to data on precompiled headers (and because of that, not so fond of them), I know some things about it, have read stuff about it, but on for example mfc projects on windows I have experienced several problems with them. I don't like them, but as said maybe I should study them a bit more.
Back to the problem : my compile on linux also fails with the above mentioned problem. I have GCC 4.0.2.
So that would mean that CB_PRECOMP is probably defined, did not test or look for it yet. So forgive my possible ignorance.
thomas:
OK, finally found the reason. As usual, the solution that you fail to see is the obvious one :lol:
sdk_precomp.h contains this:
--- Code: ---#ifndef __WXMSW__
// For non-windows platforms, one PCH (sdk.h) is enough...
#include <sdk.h>
#else
...
--- End code ---
All the includes are in the else branch. I have no idea what the reasoning behing this is, but hey ;)
Committed patch :)
--- Quote ---how about doing the simple thing : add include of <wx/dir.h> in configmanager.cpp (like always).
--- End quote ---
This is done, but only if no precompilation is used.
atwins:
OK, look. The reason for the non-compiling problem was that the same list of includes is in 2 places: sdk.h and sdk_precomp,h. Linux uses sdk.h and windows gets the other. Updating sdk_precomp.h with a wx include (eg wx/dir.h) does not automatically put it in sdk.h. Somebody has to KNOW to put it in 2 places. Never the way to go if it is easy to avoid.
That huge list of includes should be independent and in its own file and included in both sdk.h and sdk_precomp.h. This is the brute-force solution. The subtle solution is to have all the includes that are common to both platforms in one file and only the unique Windows or Unix or whatever in separate files. But that would take a bit more knowledge of the entire program and its architecture than I have at this time.
I'll try to be quiet now...
Navigation
[0] Message Index
[*] Previous page
Go to full version