Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Modified & Improved wxWidgets Project Wizard
mandrav:
--- Quote from: Biplab on January 02, 2007, 07:54:46 pm ---I have few queries.
* Does Code::Blocks support PCH for compilers other than GCC?
* How is the PCH handled internally by Code::Blocks?
--- End quote ---
PCH support is provided for GCC currently and is hardcoded. This feature needs some planning in order to be generally available for all compilers that support PCHs.
The main reason I only added PCH support for GCC is that I had no clue how to do it for other compilers...
TDragon:
--- Quote from: mandrav on January 02, 2007, 10:07:18 pm ---This feature needs some planning in order to be generally available for all compilers that support PCHs.
--- End quote ---
Quoted for truth. For instance, MSVC requires one to compile a PCH through a separate source file, and then specify that the header is a PCH in the command line for every file that needs to use it.
Biplab:
--- Quote from: RJP Computing on January 02, 2007, 08:54:54 pm ---Great Biplab. When can I get my hands on the updated wizard code?
--- End quote ---
I'm trying to upload it tonight.
--- Quote from: mandrav on January 02, 2007, 10:07:18 pm ---This feature needs some planning in order to be generally available for all compilers that support PCHs.
--- End quote ---
All the compilers have different requirements. That is the main problem. GCC seems to be worst among them. It needs the header and gch file to be in the same directory.
Old wizard handles the gch file effectively, but if a different target is build, the invalid-gch warning comes up. I tried to move the file to <Obj>\<Target> directory to solve this. But GCC is not accepting that and after creating GCH file it is not using it. I have included the directory in search path, but no result. So I would not look into it for time being.
This is one of the reason I prefer not use GCC for my project. Though it's Standard Compliant, but it's too slow. It took 30 sec to compile my project in PCH mode!!
Regarding the PCH support in Code::Blocks I have few suggestions, which I'll post later.
mandrav:
--- Quote ---GCC seems to be worst among them. It needs the header and gch file to be in the same directory.
--- End quote ---
That is certainly not true. Why do you think there are the different PCH options in the project properties dialog? As long as the compiler can locate the .gch file before the .h one, it will use the PCH...
Biplab:
--- Quote from: mandrav on January 03, 2007, 01:30:25 pm ---
--- Quote ---GCC seems to be worst among them. It needs the header and gch file to be in the same directory.
--- End quote ---
That is certainly not true. Why do you think there are the different PCH options in the project properties dialog? As long as the compiler can locate the .gch file before the .h one, it will use the PCH...
--- End quote ---
Sorry for the incomplete comment about GCC. There are no different options in project properties dialog. What I tried to say is the approach to handle PCH for each compiler is bit different.
For Borland, there are couple of switches.
* -H - Create / Use PCH
* -Hu - Use only
* -H=<path>\<pchfilename>.csm - Specify the PCH file
For MSVC 8,
* /Yc"<pchheader>.h" - Create / Use PCH through file.h
* /Yu - Use only
* /Fp"<pchfile>.pch" - Specify the PCH file
Or compile a cpp file with appropriate switches with MSVC. They have similarities in feature, but they don't work similarly.
I had tried tweaking the wizard using the following manual.
http://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html
Options for PCH are -
* Keep file.h and file.h.gch in same folder.
* Create a file.h.gch folder and create the PCH inside that.
* If the GCH file is in different folder specify that using -I switch.
Second option is followed by Code::Blocks. I tried the third one it seems that it is not working through Code::Blocks. I have tried specifying the GCH dir at the beginning. Still it didn't work.
Any suggestions on what went wrong?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version