Author Topic: How to change path of wx_pch.h.gch?  (Read 6880 times)

Offline blockn102

  • Single posting newcomer
  • *
  • Posts: 7
How to change path of wx_pch.h.gch?
« on: December 10, 2008, 04:26:37 am »
How to change path of wx_pch.h.gch?

Code
Project\wx_pch.h.gch\Debug_wx_pch_h_gch

I want custom path (move to C:\Temp\wxProjects) for easy to share project.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: How to change path of wx_pch.h.gch?
« Reply #1 on: December 27, 2008, 07:48:00 am »
I have tried to find some option or directory setting to change this default behavior, But I'm sorry, I can't find the method.

But It's useful to change the PCH folder to share with all the wxWidgets projects.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: How to change path of wx_pch.h.gch?
« Reply #2 on: December 27, 2008, 08:04:22 am »
The pre-compiled header has three options were the pch file is saved.

Look under
"Project" -> "properties"
section called "precompilied header" strategy

I used the default option it works good, but not sure any of the options does exactly what you want because I do not understand the problem you wish to fix.

Tim S

C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: How to change path of wx_pch.h.gch?
« Reply #3 on: December 27, 2008, 08:17:26 am »
thanks for your reply.
I will restate my question:

Suppose I have two wxWigets project ,say  projectA and projectB.
I wonder whether these two projects can share the same PCH output files.
By default. the PCH output is located in projectA\wx_pch.h.gch and projectB\wx_pch.h.gch, so I want to set them to the same path to save disk space and compiling time.

Thanks again!

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: How to change path of wx_pch.h.gch?
« Reply #4 on: December 27, 2008, 08:38:48 am »
And, the reason you can not move the wx_pch.h to an common folder is what?
Or did you not try that?

The wx_pch.h determines the PCH file locations in 2 of the 3 settings.
Note: PCH means pre-complied header is this case called wx_pch.h.gch

Note: I do not use the header wx_pch.h file myself so not sure what it contains.
I use the <wx/wxprec.h> directly.

Tim S
« Last Edit: December 27, 2008, 08:42:14 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: How to change path of wx_pch.h.gch?
« Reply #5 on: December 27, 2008, 08:53:04 am »
Quote
And, the reason you can not move the wx_pch.h to an common folder is what?
Or did you not try that?

The wx_pch.h determines the PCH file locations in 2 of the 3 settings.
Note: PCH means pre-complied header is this case called wx_pch.h.gch
Oh, Yes, you are right, I haven't thought to move the wx_pch.h to a common file. Thanks.

Quote
Note: I do not use the header wx_pch.h file myself so not sure what it contains.
I use the <wx/wxprec.h> directly.
wx_pch.h file do nothing except include  <wx/wxprec.h>.

That's the work by code::blocks's wizard.

using the  <wx/wxprec.h> directly can really save OP's problem, that's because the PCH output file will be located in wx/.....

Thanks for your informative suggestion.





If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.