How to use precompiled headers with MinGW?

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.
Lestat
Experienced Solver
Experienced Solver
Posts: 68
Joined: Tue Apr 26, 2005 1:04 am
Location: Kemerovo, Russia

Post by Lestat »

Jorg wrote:It might also be useful in the wxWidgets WIKI. I will make this a sticky for now.

- Jorgen
I can write an article fow wxWiki page. What do you think?
WinXP Pro | Dev-C++ 5 | wxWidgtes 2.6.0 | wxGlade
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

Please do so! They encourage user documentation, because they cannot handle it all

Thanks,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Lestat
Experienced Solver
Experienced Solver
Posts: 68
Joined: Tue Apr 26, 2005 1:04 am
Location: Kemerovo, Russia

Post by Lestat »

Jorg wrote:Please do so! They encourage user documentation, because they cannot handle it all

Thanks,
- Jorgen
I'll do it when I'll have spare time.
WinXP Pro | Dev-C++ 5 | wxWidgtes 2.6.0 | wxGlade
Lestat
Experienced Solver
Experienced Solver
Posts: 68
Joined: Tue Apr 26, 2005 1:04 am
Location: Kemerovo, Russia

Post by Lestat »

I wrote an article for wxWiki about pch. Look here: http://wiki.wxwidgets.org/wiki.pl?Precompiled_Headers. Any suggestions are encouraged.
WinXP Pro | Dev-C++ 5 | wxWidgtes 2.6.0 | wxGlade
lowjoel
Part Of The Furniture
Part Of The Furniture
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel »

not only pch, but mainly pch FOR mingw because pch for other compilers has been pretty well done.

anyway, fyi, with a pch, my project compiled in 30 seconds, compared to 1:15 without :D saves me heaps of time if you add the man hours.
microchip
In need of some credit
In need of some credit
Posts: 2
Joined: Sat Oct 29, 2005 4:44 pm

Post by microchip »

I've followed all the instructions in the wiki, but it still doesn't shorten my compiling time.

I'm using DevC++ on a Athlon 64 3200+, and it takes 8 seconds to compile a small "hello world" style wxWidgets program. What I did, is copy the contents of <wx/wx.h> into a file, which I called wxprec.h. Then I compiled it using:

g++ pathtofile/wxprec.h

This resulted in wxprec.h.gch

When the compiling time didn't shorten, I thought I must have left out some compiling options since precompiled headers don't work unless they've been compiled with the same options as the project. So I then looked at my project options to see what parameters were passed to the compiler. I copied all the options from the "C++ compiler" section behind the path.

g++ pathtofile/wxprec.h -fno-rtti -fno-exceptions -fno-pcc-struct-return -fstrict-aliasing -Wall -D__WXMSW__ -D__GNUWIN32__ -D__WIN95__

Though after doing this, the compiling time STILL doesn't get shorter. What am I doing wrong?

P.S.: I'm including my wxprec.h file, not the wxprec.h.gch
Frantisek_Sidak
Earned a small fee
Earned a small fee
Posts: 24
Joined: Thu Aug 04, 2005 7:26 am
Location: Czech Republic, Liberec

It works!

Post by Frantisek_Sidak »

I made these changes too and it works! Thank you mens for your advices! (from 64 to 29 sec).
I've followed all the instructions in the wiki, but it still doesn't shorten my compiling time.
I have diferent complier arguments, as described before. Maybe it is the reason.

My last question is: In whitch header file is defined _() etc. macro. I was trying to put into my precheders.h file only needed headers, but I can't find it...

Thanks one more time ;)
WinXP Home SP2
Dev-C++ 4.9.9.2 (+included tools)
Unicode wxWidgets 2.6.2, libunicows
leio
Can't get richer than this
Can't get richer than this
Posts: 802
Joined: Mon Dec 27, 2004 10:46 am
Location: Estonia, Tallinn
Contact:

Post by leio »

_() should be in wx/intl.h
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD

Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
prodome
In need of some credit
In need of some credit
Posts: 6
Joined: Tue Dec 11, 2007 5:24 pm
Location: Vienna

config xml

Post by prodome »

what is

config xml

mentioned above?

do i need it?
Post Reply