Board index » cppbuilder » precompiled header problem in BDS2006, any solution?
Peter Sprenger
CBuilder Developer |
Peter Sprenger
CBuilder Developer |
precompiled header problem in BDS2006, any solution?2007-05-09 03:04:29 PM cppbuilder13 I switched from BCB6 to BDS2006 and have again the problem, that I cannot use precompiled headers, when math.h or a header file that has "initialized data in header" is included before pragma hdrstop. Has anybody found a convenient way to get around this? I think CG will not change anything in the upcoming BDS2007. Regards, Peter |
Leo Siefert
CBuilder Developer |
2007-05-09 08:00:37 PM
Re:precompiled header problem in BDS2006, any solution?
Peter Sprenger wrote:
QuoteHas anybody found a convenient way to get around this? to the VCL and Windows headers you are probably including in your BCB projects. QuoteI think CG will not change anything in the upcoming BDS2007. |
Peter Sprenger
CBuilder Developer |
2007-05-09 09:55:23 PM
Re:precompiled header problem in BDS2006, any solution?Quote>Has anybody found a convenient way to get around this? precompilation, put it in my "math2.h" and include this file after pragma hdrstop. After 1 hour wasted for this, I can still try to find a solution for the other "offending" header files. This is NOT convenient, and has possibly to be redone for BDS2007. Quote>I think CG will not change anything in the upcoming BDS2007. {smallsort} |
David Dean [CodeGear]
CBuilder Developer |
2007-05-10 01:50:43 AM
Re:precompiled header problem in BDS2006, any solution?
In article <f1rrp1$t5l$ XXXX@XXXXX.COM >,
Peter Sprenger < XXXX@XXXXX.COM >wrote: QuoteHas anybody found a convenient way to get around this? I think CG will this file, but still see the warning, I'd like to see the test case. -- -David Dean CodeGear C++ QA Engineer <blogs.codegear.com/ddean/> |
Duane Hebert
CBuilder Developer |
2007-05-10 03:12:06 AM
Re:precompiled header problem in BDS2006, any solution?
"David Dean [CodeGear]" < XXXX@XXXXX.COM >wrote in message
QuoteIn article <f1rrp1$t5l$ XXXX@XXXXX.COM >, intermittent IIRC and it also showed up as a complaint about dialogs.hpp is some cases. But basically something like: class doh { void spoo(int x = 42); }; would cause problems. We would basically watch the compiler until it generated this message and then try to figure out what it was compiling at the time. I have BDS explorer at home. If I have a chance, I'll try to generate a test case. |
David Dean [CodeGear]
CBuilder Developer |
2007-05-10 08:49:20 AM
Re:precompiled header problem in BDS2006, any solution?
In article <46421d09$ XXXX@XXXXX.COM >,
"Duane Hebert" < XXXX@XXXXX.COM >wrote: QuoteI think that if you have default variables assigned to functions in bail on generating PCH if it catches actual initialized data. (IOW, don't do this on purpose) -- -David Dean CodeGear C++ QA Engineer <blogs.codegear.com/ddean/> |
Duane Hebert
CBuilder Developer |
2007-05-10 09:03:33 AM
Re:precompiled header problem in BDS2006, any solution?
"David Dean [CodeGear]" < XXXX@XXXXX.COM >wrote in message
QuoteIn article <46421d09$ XXXX@XXXXX.COM >, In that case, the only ones that I know of have to do with math.hpp. |
David Dean [CodeGear]
CBuilder Developer |
2007-05-10 12:31:56 PM
Re:precompiled header problem in BDS2006, any solution?
In article <46426f56$ XXXX@XXXXX.COM >,
"Duane Hebert" < XXXX@XXXXX.COM >wrote: QuoteOk. Then it's intentional that you can't pre-compiled -- -David Dean CodeGear C++ QA Engineer <blogs.codegear.com/ddean/> |
David Perkins
CBuilder Developer |
2007-05-10 05:19:21 PM
Re:precompiled header problem in BDS2006, any solution?QuoteOk. Then it's intentional that you can't pre-compiled dialog.hpp. My use of default args doesn't break the PCH. |
Darko Miletic
CBuilder Developer |
2007-05-10 09:22:34 PM
Re:precompiled header problem in BDS2006, any solution?
David Perkins < XXXX@XXXXX.COM >wrote:
Quote>Ok. Then it's intentional that you can't pre-compiled int test = 123; //fails for pch const int test2 = 123; //everything is fine Here is the header: #ifndef STHDR #define STHDR int test = 123; const int test2 = 123; struct ttt { void SomeMethod (int p = 0) {} void SomeOtherMethod (const int p = 0) {} }; void stest (int d, const char* = 0); #endif /*STHDR*/ |
Bob Gonder
CBuilder Developer |
2007-05-10 10:50:06 PM
Re:precompiled header problem in BDS2006, any solution?
Darko Miletic wrote:
QuoteYou are right. I tried reproducing this error with custom header. Any common class with wethods that have default value pass ok. I would think if out-of-line inline functions is enabled, that the header would emit. (Or if the compiler otherwise decided to out-of-line the functions.) |
Duane Hebert
CBuilder Developer |
2007-05-10 11:02:33 PM
Re:precompiled header problem in BDS2006, any solution?QuoteYou are right. I tried reproducing this error with custom header. Any precompiling has stopped due to code in header of dialogs.hpp. This will be where no dialogs.hpp is used. We would watch the compilation until the error popped up, diagnose the includes and move them after the pragma hdrstop until the error went away. Very time consuming. Eventually and in every case we found that the culprit was a class that have a function with a default value. As I said before, I could never create a test project to duplicate this but I have seen other people post similar complaints. I have the impression that David Dean knows something about it since he said it was a request to change this. At any rate, what we ended up doing is to just precompile vcl.h. Reduced efficiency but works to some extent. QuoteWhat generates problem is placing variable in header and assigning it some |
Leroy Casterline
CBuilder Developer |
2007-05-13 04:59:38 AM
Re:precompiled header problem in BDS2006, any solution?
On Thu, 10 May 2007 10:19:21 +0100, David Perkins < XXXX@XXXXX.COM >
wrote: Quote>Ok. Then it's intentional that you can't pre-compiled |