How to Use Precompiled Header with wx2.5.3 [Mingw 3.4.2]

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
jkksdlinux
In need of some credit
In need of some credit
Posts: 4
Joined: Sun Sep 26, 2004 8:21 am

How to Use Precompiled Header with wx2.5.3 [Mingw 3.4.2]

Post by jkksdlinux » Thu Oct 28, 2004 11:42 am

I use dev c++ with mingw 3.4.2 to compile my wx program.

but i dont know how to use the Precompiled header with it.

Dose anyone know how to use the preconpiled header with wx ?

Or where can i find the answer ? :roll:

Plz tell me

thank you very much

---------------------------------
OS:win xp sp1
IDE: dev c++
Compiler : mingw 3.4.2
Wxwidgets : 2.5.3

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Thu Oct 28, 2004 1:27 pm

Hi!
Last time I checked the 3.4.x releases (at least the mingw ones) didn't have support for precompiled headers yet. I suppose it's going to take a while till we get to see this feature...
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

NinjaNL
Moderator
Moderator
Posts: 899
Joined: Sun Oct 03, 2004 10:33 am
Location: Oosterwolde, Netherlands

Post by NinjaNL » Thu Oct 28, 2004 4:09 pm

According to this http://gcc.gnu.org/onlinedocs/gcc-3.4.2 ... ed-Headers you can.

Isn't this what

Code: Select all

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
does?

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Thu Oct 28, 2004 4:17 pm

Hi!
While this is indeed true for the original gnu gcc releases, I remember that mingw doesn't support it yet.
Maybe I'm mistaken -> somebody please confirm this! :D
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

eros
I live to help wx-kind
I live to help wx-kind
Posts: 162
Joined: Mon Sep 06, 2004 1:40 am
Location: Argentina

Post by eros » Thu Oct 28, 2004 7:13 pm

I read somewhere that isn't even confirmed that latest candidate mingw works under Win9x, my guess is that precompiled headers aren't supported (yet).
...

cg
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Sun Aug 29, 2004 12:33 am
Location: Canada
Contact:

Post by cg » Thu Oct 28, 2004 10:59 pm

Yup its supported:

3.4.2 Readme:

Pre-compiled headers appear to work on at least two systems (NT4 and XP).
I have not tested other windows versions. Please consider this feature
a "technology preview".

If I remember correctly it was in 3.4.0 but was broken. Then was fixed for 3.4.1. But I dont see the readme for 3.4.1 online anymore....

HTH

CG

Avi
Super wx Problem Solver
Super wx Problem Solver
Posts: 398
Joined: Mon Aug 30, 2004 9:27 pm
Location: Tel-Aviv, Israel

Post by Avi » Fri Oct 29, 2004 5:16 am

I use MinGW's GCC 3.4.2 together with Msys shell to compile wxWidgets 2.5.3, and precompiled headers work just perfectly. I do not know, though, how to make it work on Dev C++...

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Fri Oct 29, 2004 9:02 am

Hi!
Indeed, it works. I'm sorry for stating it the other way round.
The problem is that with gcc wxWidgets doesn't enable precompiled headers through wxprec.h. Must be a config thingy somewhere in the header. To "compile" a precompiled header yourself create a header file that include all needed header files and use this one in all source files. Use "g++ filename.h" to create the gch file. Including the wxWidgets headers this gch file will be rather big, about 28 Mb for me.
Making it work with Dev-C++ is a bit more complicated. I suppose one could create a cpp file, include the header file to precompille , override the make command in the project options and specify "-x c++-header" as language type for the cpp file. That way a precompiled header should get build.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

Post Reply