Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
new wxWidget(wxSmith) project
killerbot:
as said, I would suggest to be explicit and not just wx.h.
Things are clearer to the user also, he knows which headers are in play, and no need to search wx.h for which header it could be. Less surprises if certainly a header get's kicked out of wx.h. Hopefully this won't happen but you never know with these wx guys.
And secondly if you don't use pch, wx.h is bringing way to many things into play and will slow down compilation.
Biplab:
--- Quote from: killerbot on June 23, 2007, 11:51:35 am ---as said, I would suggest to be explicit and not just wx.h.
Things are clearer to the user also, he knows which headers are in play, and no need to search wx.h for which header it could be. Less surprises if certainly a header get's kicked out of wx.h. Hopefully this won't happen but you never know with these wx guys.
And secondly if you don't use pch, wx.h is bringing way to many things into play and will slow down compilation.
--- End quote ---
Got your point. I'll make the necessary changes. :)
@All, wxwidgets wizard is now working well with/without GUI designers.
byo:
--- Quote from: Biplab on June 23, 2007, 11:37:44 am ---The problem is you've removed the following lines
--- Quote ---#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
--- End quote ---
Now wx.h includes a number of commonly used headers. So if it's not there, we've to include <wx/frame.h>, <wx/button.h>, etc for all the classes we want to use. There lies the problem. :)
--- End quote ---
Now I get it :), haven't checked that with pch disabled. Lesson for me: alays consult wxWizard changes with you before applying.
Regards
BYO
Biplab:
Byo,
Another point. It seems that you've removed _BORLANDC_ preprocessor directive and the associated pragma.
Please note that this will affect the compilation of Pch enabled App with BCC.
BCC 5.5.1 can't generate Pre-Compiled Header from a Header file. :( What it does is that it creates the PCH on the fly while compiling a cpp file. It includes all the headers found in a cpp file to the generated pch file. This pragma is necessary to tell BCC that - "Please don't include any header files inside the PCH file from now on." This prevents regeneration of PCH file while compiling a large app.
If you remove that pragma, then BCC will include all the headers found in that cpp file and will include them in PCH file (if they were not included earlier). This will slow down the compilation process.
I hope I could make my point clear to you. :)
IMHO, if you remove them, then you may have to tell users that wxSmith doesn't support pch creation with BCC 5.5. :)
Best Regards,
Biplab
byo:
--- Quote from: Biplab on June 23, 2007, 01:18:22 pm ---Another point. It seems that you've removed _BORLANDC_ preprocessor directive and the associated pragma.
--- End quote ---
Hmm, I was just wondering - there's this _BORLANDC_ stuff inside wx_pch.h file:
--- Code: ---#ifndef WX_PCH_H_INCLUDED
#define WX_PCH_H_INCLUDED
// basic wxWidgets headers
#include <wx/wxprec.h>
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#ifdef WX_PRECOMP
// put here all your rarely-changing header files
#endif // WX_PRECOMP
#endif // WX_PCH_H_INCLUDED
--- End code ---
And when the project is created and uses wxSmith, it includes this wx_pch just at the beginning of each source. In fact it should work as you've said - it will only cache <wx/wxprec.h> header. So it should work correctly. And it really cleans the source. Maybe with one exception: the "// put here all your rarely-changing header files" content should be placed before _BORLANDC_ stuff to cache rarely-changing project headers too. The only problem with wxSmith is that this "wx_pch.h" is not included for newly created resources but I'll probably try to detect such file and add it automatically.
Same technique could be used for other GUI designers too so everything related to pch would be put inside wx_pch.h and there won't be any need of using those #pragma hdrstop in sources anymore. What do you think ?
Regards
BYO
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version