| View previous topic :: View next topic |
| Author |
Message |
Rudy Velthuis [TeamB] Guest
|
Posted: Thu Feb 02, 2006 7:06 pm Post subject: Re: Precompiled headers - again |
|
|
Duane Hebert wrote:
| Quote: |
"Albert Wiersch" <mrinternetnewsborland (AT) wiersch (DOT) com> wrote in message
news:43e25f63$1 (AT) newsgroups (DOT) borland.com...
Do you know how I can use precompiled headers without dinkumware
getting
in
the way?
This was the same with BCB6/StlPort. I
don't have 2006 but with BCB6 you had
to use #pragma hdrstop before any includes
that you didn't want precompiled.
So basically it's like:
#include
#include
#pragma hdrstop
#include
Hopefully this pragma is still around.
|
It is.
--
Rudy Velthuis [TeamB] http://rvelthuis.de/
"Obstacles are those frightful things you see when you take your eyes
off your goal."
- Henry Ford (1863-1947)
|
|
| Back to top |
|
 |
Albert Wiersch Guest
|
Posted: Thu Feb 02, 2006 7:18 pm Post subject: Precompiled headers - again |
|
|
What is dinkumware? It is messing up my precompiled headers:
[C++ Warning] xlocinfo(53): W8058 Cannot create pre-compiled header:
initialized data in header
I had to manually edit VCL header files to remove the default values from
some of the function prototypes so that precompiled headers would work.
What is this dinkumware stuff and do I need it? I don't recall anything like
this in C++Builder 6. How do I get rid of it?
--
Albert Wiersch
http://www.htmlvalidator.com/
|
|
| Back to top |
|
 |
Chris Uzdavinis (TeamB) Guest
|
Posted: Thu Feb 02, 2006 7:23 pm Post subject: Re: Precompiled headers - again |
|
|
"Albert Wiersch" <mrinternetnewsborland (AT) wiersch (DOT) com> writes:
| Quote: | What is this dinkumware stuff and do I need it? I don't recall anything like
this in C++Builder 6. How do I get rid of it?
|
Dinkumware is the company that implemented the C++ Standard Library
that ships with the new compiler. It is the most standard-conformant
implementation available.
I don't know how to "get rid of it", but have never tried. On earlier
verions of BCB, there was a macro to select whether you used the
STLport or the RogueWave implementations. Perhaps they have the same
type of mechanism now. (Or perhaps they only ship Dinkumware
implementation now. I don't know, and cannot check right now.)
--
Chris (TeamB);
|
|
| Back to top |
|
 |
Albert Wiersch Guest
|
Posted: Thu Feb 02, 2006 7:40 pm Post subject: Re: Precompiled headers - again |
|
|
Do you know how I can use precompiled headers without dinkumware getting in
the way?
Thanks.
--
Albert Wiersch
http://www.htmlvalidator.com/
"Chris Uzdavinis (TeamB)" <chris (AT) uzdavinis (DOT) com> wrote
| Quote: | "Albert Wiersch" <mrinternetnewsborland (AT) wiersch (DOT) com> writes:
What is this dinkumware stuff and do I need it? I don't recall anything
like
this in C++Builder 6. How do I get rid of it?
Dinkumware is the company that implemented the C++ Standard Library
that ships with the new compiler. It is the most standard-conformant
implementation available.
I don't know how to "get rid of it", but have never tried. On earlier
verions of BCB, there was a macro to select whether you used the
STLport or the RogueWave implementations. Perhaps they have the same
type of mechanism now. (Or perhaps they only ship Dinkumware
implementation now. I don't know, and cannot check right now.)
--
Chris (TeamB);
|
|
|
| Back to top |
|
 |
Duane Hebert Guest
|
Posted: Thu Feb 02, 2006 8:08 pm Post subject: Re: Precompiled headers - again |
|
|
"Albert Wiersch" <mrinternetnewsborland (AT) wiersch (DOT) com> wrote
| Quote: |
Do you know how I can use precompiled headers without dinkumware getting
in
the way?
|
This was the same with BCB6/StlPort. I
don't have 2006 but with BCB6 you had
to use #pragma hdrstop before any includes
that you didn't want precompiled.
So basically it's like:
#include <vcl>
#include <whatever from borland>
#pragma hdrstop
#include <whatever's getting xlocinfo(53) to be parsed>
Hopefully this pragma is still around.
I'm a bit surprised that it still complains about dialogs.hpp
though :-(
|
|
| Back to top |
|
 |
Duane Hebert Guest
|
Posted: Thu Feb 02, 2006 8:09 pm Post subject: Re: Precompiled headers - again |
|
|
"Chris Uzdavinis (TeamB)" <chris (AT) uzdavinis (DOT) com> wrote
| Quote: | I don't know how to "get rid of it", but have never tried. On earlier
verions of BCB, there was a macro to select whether you used the
STLport or the RogueWave implementations. Perhaps they have the same
type of mechanism now. (Or perhaps they only ship Dinkumware
implementation now. I don't know, and cannot check right now.)
|
I would think that trying to use
#pragma hdrstop is better than
dumping dinkumware. It beats the
hell out of stlport or rogue wave.
|
|
| Back to top |
|
 |
Andrue Cope [TeamB] Guest
|
Posted: Fri Feb 03, 2006 9:21 am Post subject: Re: Precompiled headers - again |
|
|
Albert Wiersch wrote:
| Quote: | What is dinkumware? It is messing up my precompiled headers:
[C++ Warning] xlocinfo(53): W8058 Cannot create pre-compiled header:
initialized data in header
|
DinkumWare is the company behind the STL implementation that BDS2006
uses. It is a very popular and common STL and MS has been shipping it
with VC for several years.
I have my doubts sbout it being Dinkumware causing you problems if only
because we use the STL a lot (and I'm sure others do) and I have not
had any problems nor read of any until your post.
It might help if you could post an example project to QC to be
investigated.
| Quote: | I had to manually edit VCL header files to remove the default values
from some of the function prototypes so that precompiled headers
would work.
|
Then that would be the VCL header files at fault I'd have thought. BCB6
sometimes got confused and would complain about dialogs.hpp and
precompiled headers. That's a known issue and perhaps you've found a
similar one in BDS.
--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html
|
|
| Back to top |
|
 |
Andreas Hausladen Guest
|
Posted: Fri Feb 03, 2006 10:52 am Post subject: Re: Precompiled headers - again |
|
|
Andrue Cope [TeamB] wrote:
| Quote: | Then that would be the VCL header files at fault I'd have thought. BCB6
sometimes got confused and would complain about dialogs.hpp and
precompiled headers. That's a known issue and perhaps you've found a
similar one in BDS.
|
I have such a problem with the Qt 4 headers. If I add a non-inlined
function to one of my header files that is is precompiled, the compiler
starts to complain about code in the pch in the qstrings.h file. After
inlining my non-inlined function the compiler happily precompiles the
headers. This makes finding the actual problematic code very hard.
--
Regards,
Andreas Hausladen
|
|
| Back to top |
|
 |
Duane Hebert Guest
|
Posted: Fri Feb 03, 2006 3:25 pm Post subject: Re: Precompiled headers - again |
|
|
"Andreas Hausladen" <AndreasDOTHausladen (AT) gObviousToBeRemovedmx (DOT) de> wrote in
message news:43e334fe$1 (AT) newsgroups (DOT) borland.com...
| Quote: | I have such a problem with the Qt 4 headers. If I add a non-inlined
function to one of my header files that is is precompiled, the compiler
starts to complain about code in the pch in the qstrings.h file. After
inlining my non-inlined function the compiler happily precompiles the
headers. This makes finding the actual problematic code very hard.
|
Qt uses default values and these usually trip this "code in header"
problem. You'll get the same thing with your own classes though
ISTR that it's intermittent.
One solution would be to add your Qt includes after
the pragma hdrstop. This means that it won't precompile them
but it won't prevent precompiling the others.
With BCB we ended up just precompiling VCL. It sped
up builds enough to be usable and stopped the dialogs.hpp
warning thing. Of course, if you're using Qt your likely not
using VCL <g>
|
|
| Back to top |
|
 |
Andreas Hausladen Guest
|
Posted: Fri Feb 03, 2006 6:57 pm Post subject: Re: Precompiled headers - again |
|
|
Duane Hebert wrote:
| Quote: | Qt uses default values and these usually trip this "code in header"
problem. You'll get the same thing with your own classes though
ISTR that it's intermittent.
|
That's not the problem in this case. The problem are mostly function that
are declared this way:
Q_EXPORT inline func();
Ever seen an inlined exported function? Either it is inlined or exported
but not both. After changing them to not exported the compiler has no
problems. BTW I'm talking about Qt 4.1 which doesn't support BCB without
the patch that I wrote and now port to BDS 2006 (Additional Compiler
Support for Qt 4 http://www.sf.net/projects/qtwin)
--
Regards,
Andreas Hausladen
|
|
| Back to top |
|
 |
Duane Hebert Guest
|
Posted: Fri Feb 03, 2006 7:40 pm Post subject: Re: Precompiled headers - again |
|
|
"Andreas Hausladen" <AndreasDOTHausladen (AT) gObviousToBeRemovedmx (DOT) de> wrote in
message news:43e3a6ad$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Duane Hebert wrote:
Qt uses default values and these usually trip this "code in header"
problem. You'll get the same thing with your own classes though
ISTR that it's intermittent.
That's not the problem in this case. The problem are mostly function that
are declared this way:
Q_EXPORT inline func();
Ever seen an inlined exported function? Either it is inlined or exported
|
Is this in their source or something you've added? You
normally don't build their source except the initial configuration,
so if you're including the header in one of your cpp files,
just stick the pragma before it. Maybe I'm missing something...
| Quote: | but not both. After changing them to not exported the compiler has no
problems. BTW I'm talking about Qt 4.1 which doesn't support BCB without
the patch that I wrote and now port to BDS 2006 (Additional Compiler
Support for Qt 4 http://www.sf.net/projects/qtwin)
|
I've noticed this from some of your posts. We're currently
using MSVC but it's good to know that it can be done
with Borland.
|
|
| Back to top |
|
 |
Andreas Hausladen Guest
|
Posted: Fri Feb 03, 2006 8:04 pm Post subject: Re: Precompiled headers - again |
|
|
Duane Hebert wrote:
| Quote: | Q_EXPORT inline func();
Ever seen an inlined exported function? Either it is inlined or
exported
Is this in their source or something you've added?
|
It's in their source. I have modified it to Q_INLINED_EXPORT which is
conditionally set to "QEXPORT inline" (MSVC/GCC) or "inline" (BCB). But it
looks like there are more of these "wrong" functions. But it is hard to
find them because BCB reports all the problems in qstring.h which itself
has no problems if it is precompiled.
#include <qstring.h>
#pragma hdrstop
works. But
#include <qstring.h>
#include <qrgb.h>
#pragma hdrstop
fails in qstring.h
| Quote: | I've noticed this from some of your posts. We're currently
using MSVC but it's good to know that it can be done
with Borland.
|
Yes it can and I see all the non-compliance bugs in BCB. (BTW bcc32pch
started as a tool for compiling Qt 4 faster)
--
Regards,
Andreas Hausladen
|
|
| Back to top |
|
 |
Duane Hebert Guest
|
Posted: Fri Feb 03, 2006 8:25 pm Post subject: Re: Precompiled headers - again |
|
|
"Andreas Hausladen" <AndreasDOTHausladen (AT) gObviousToBeRemovedmx (DOT) de> wrote in
message news:43e3b66a$1 (AT) newsgroups (DOT) borland.com...
| Quote: | #include <qstring.h
#pragma hdrstop
works. But
#include
#include
#pragma hdrstop
fails in qstring.h
|
OK that's weird. qrgb.h has
a bunch of
Q_GUI_EXPORT inline int qRed(QRgb rgb) // get red part of RGB
{ return ((rgb >> 16) & 0xff); }
I would expect that to give Borland's precompiler a problem
as there actually is code in the header. Why it chokes on
QString.h though, I don't know.
Does it work if you do:
#pragma hdrstop
#include <qstring.h>
#include <qrgb.h>
Qt may be using that define with inline as some
compiler may undef it and the function would then
be inline. I think it should be harmless to have both.
I haven't tried this with MSVC as we're not using
PCH.
|
|
| Back to top |
|
 |
|