Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
SVN 2835: Missing subdirectory "resources" under "src/plugins/contrib/cb_koders"
MortenMacFly:
--- Quote from: vesselin_peev on August 11, 2006, 11:06:30 pm ---I found that the line
--- Code: ---#include "sdk.h"
--- End code ---
should be added at the top [...]
--- End quote ---
Thanks for this information. Anway: Adding sdk.h at this point is not a good solution. The kodersdialog has nothing to do with the C::B SDK. I know why this works (the sdk.h file simply includes a bunch of wxWidgets headers) but again: This is not a good solution. I can find out why on monday (then I have access to a linux machine again) so it will have to wait for now (it and compiles nicely on windows so far...).
With best regards, Morten.
killerbot:
The fact we put the include sdk.h there, is to support precompiled headers.
You could also directly use the wx precompiled header for this. Note that the sdk.h has a bigger list then the native wx one. :evil:
As it is again now, sureley the including of wx/string.h is missing !!
It might come in through the including of wx/wxprec.h in the kodersdialog.h
As for as I have been told, you should NOT include thoe precomiled driven headers in a header file
So
1) the including of wx/wxprec.h needs to be removed from the header
I don't know it that was generated by wxSmith or not, if it is we should talk to byo. He's already aware of the not needed header includings generated in the dialog header, and told m that would be fixed in the new wxSmith. Therefor I would suggest @Morton, you put back back the forward declarations and the includes in the cpp file (see point 3), so that when the switch no new wxSmith will be made, that the code is already ok, and we just need to move the wxSmith block (from .h to .cpp)
2) wx/string.h include should be added (I will do that again)
3) Choose if you want to work with precompiled headers or not :
if not then it should be like this :
--- Code: ---#include <wx/button.h>
#include <wx/choice.h>
#include <wx/intl.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/string.h>
#include <wx/textctrl.h>
#include "kodersdialog.h"
--- End code ---
if yes, then it should be like this :
--- Code: ---#include "sdk.h"
#ifndef CB_PRECOMP
#include <wx/button.h>
#include <wx/choice.h>
#include <wx/intl.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/string.h>
#include <wx/textctrl.h>
#endif
#include "kodersdialog.h"
--- End code ---
Note that the result of including a precompiled header in the case when no precompiled directive is given to the project(compiler) is(should be) a no-op. So you include just nothing. So in this case, who will bring in wx/string.h. We might be lucky someone else included it, but that's no guarantee.
@Morton,
I will add the include wx/string.h . I leave the rest up to you, it's your call to either support or not support precompiled headers.
PS : will finish up my header including topic this weekend ;-)
killerbot:
--- Quote from: vesselin_peev on August 11, 2006, 11:06:30 pm ---I see you've fixed the problem. There was still a problem that kodersdialog.cpp wouldn't compile. I found that the line
--- Code: ---#include "sdk.h"
--- End code ---
should be added at the top (that's the best header to include so precompiled headers work correctly, I think). Please review and commit.
--- End quote ---
could you try again with the latest revision, and tell me what the compiler gives as error output ?
vesselin_peev:
Here it is (SVN 2839):
--- Quote ---In file included from kodersdialog.cpp:3:
kodersdialog.h:20: error: expected class-name before '{' token
kodersdialog.h:23: error: expected `)' before '*' token
kodersdialog.h:45: error: `wxCommandEvent' has not been declared
kodersdialog.h:45: error: ISO C++ forbids declaration of `event' with no type
kodersdialog.h:49: error: ISO C++ forbids declaration of `wxBoxSizer' with no type
kodersdialog.h:49: error: expected `;' before '*' token
kodersdialog.h:50: error: ISO C++ forbids declaration of `wxBoxSizer' with no type
kodersdialog.h:50: error: expected `;' before '*' token
kodersdialog.h:51: error: ISO C++ forbids declaration of `wxStaticText' with notype
kodersdialog.h:51: error: expected `;' before '*' token
kodersdialog.h:52: error: ISO C++ forbids declaration of `wxBoxSizer' with no type
kodersdialog.h:52: error: expected `;' before '*' token
kodersdialog.h:53: error: ISO C++ forbids declaration of `wxTextCtrl' with no type
kodersdialog.h:53: error: expected `;' before '*' token
kodersdialog.h:54: error: ISO C++ forbids declaration of `wxButton' with no type
kodersdialog.h:54: error: expected `;' before '*' token
kodersdialog.h:55: error: ISO C++ forbids declaration of `wxBoxSizer' with no type
kodersdialog.h:55: error: expected `;' before '*' token
kodersdialog.h:56: error: ISO C++ forbids declaration of `wxStaticText' with notype
kodersdialog.h:56: error: expected `;' before '*' token
kodersdialog.h:57: error: ISO C++ forbids declaration of `wxChoice' with no type
kodersdialog.h:57: error: expected `;' before '*' token
kodersdialog.h:58: error: ISO C++ forbids declaration of `wxChoice' with no type
kodersdialog.h:58: error: expected `;' before '*' token
kodersdialog.h:64: error: ISO C++ forbids declaration of `DECLARE_EVENT_TABLE' with no type
kodersdialog.h:64: error: expected `;' before '}' token
kodersdialog.h:64: error: expected `;' before '}' token
kodersdialog.cpp:5: error: `wxDialog' has not been declared
kodersdialog.cpp:7: error: expected constructor, destructor, or type conversionbefore "EVT_BUTTON"
kodersdialog.cpp:7: error: expected `,' or `;' before "EVT_BUTTON"
kodersdialog.cpp: In member function `wxString KodersDialog::GetSearch() const':
kodersdialog.cpp:107: error: `_' undeclared (first use this function)
kodersdialog.cpp:107: error: (Each undeclared identifier is reported only once for each function it appears in.)
kodersdialog.cpp:109: error: `txtSearch' undeclared (first use this function)
kodersdialog.cpp: In member function `wxString KodersDialog::GetLanguage() const':
kodersdialog.cpp:117: error: `_' undeclared (first use this function)
kodersdialog.cpp:119: error: `choLanguages' undeclared (first use this function)
kodersdialog.cpp: In member function `wxString KodersDialog::GetLicense() const':
kodersdialog.cpp:127: error: `_' undeclared (first use this function)
kodersdialog.cpp:129: error: `choLicenses' undeclared (first use this function)
kodersdialog.cpp: At global scope:
kodersdialog.cpp:135: error: variable or field `OnBtnSearchClick' declared void
kodersdialog.cpp:135: error: `int KodersDialog::OnBtnSearchClick' is not a static member of `class KodersDialog'
kodersdialog.cpp:135: error: `wxCommandEvent' was not declared in this scope
kodersdialog.cpp:135: error: `event' was not declared in this scope
kodersdialog.cpp:136: error: expected `,' or `;' before '{' token
make[4]: *** [kodersdialog.lo] Error 1
--- End quote ---
It's clear that the #include <wx/wxprec.h> does not bring in any of the headers including the wxBoxSizer, wxStaticText, etc, because WX_PRECOMP is not defined when compiling kodersdialog.cpp. Rather than putting the define in the makefile (you will want to do that certainly, if you want to use wxWidgets' own precompilation logic), for the test only I put #define WX_PRECOMP before the former line, and indeed, things build fine then.
I think that if you want the best flexibility things should be made to work fine in the 3 scenarios: when WX_PRECOMP and CB_PRECOMP is defined, when only one of them is defined, and when neither is defined. This is the ideal aim, right?
Also, may I ask what is the reason you support no precompilation and hassle with it? Codeblocks isn't to be build with an old compiler of the 3.x series (and probably cannot be?)? Borland, Microsoft and modern GCC compilers all support precompilation. Or is it because of better debuggability of the build process?
As Killerbot says and from what I know and how I use precompiler headers in my own projects, indeed only C/C++ source files should include headers driving precompilation (at the top), not regular header files.
killerbot:
could you try again, the ifndef CB_PRECOMP should not be around the include section in the header of kodersdialog.h (in the case like it is now and we put those includes in the header) -> rev 2840
We do offer pch, but this new plug-in does not (correctly) at the moment (as described above).
With and without pch is offered, even if your compiler offers pch, it's nice to be able not to use it. yeah yeah, i am not a pch fan ;-)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version