Board index » delphi » cannot generate pre compiled header

cannot generate pre compiled header

Hi,

#include<string>
will generate the error : "cannot generate pre compiled header : code in
header"
or, worse, with other STL files: "initilized data in header".
Without pre-compiled headers, compile time will increase beyond what I can
bear.
Of course, I could do without the pc-headers but on the other hand : you all
must work with something suitable.

I dont know if this was posted here before, but a search has not
enlightened me...

Any suggestions ?

 

Re:cannot generate pre compiled header


Quote
Ralf Treutel <Ralf.Treu...@t-online.de> wrote in message

news:3a15d601_2@dnews...

Quote
> Hi,

> #include<string>
> will generate the error : "cannot generate pre compiled header : code in
> header"
> or, worse, with other STL files: "initilized data in header".
> Without pre-compiled headers, compile time will increase beyond what I can
> bear.
> Of course, I could do without the pc-headers but on the other hand : you
all
> must work with something suitable.

> I dont know if this was posted here before, but a search has not
> enlightened me...

> Any suggestions ?

You could try being clearer about your problem.

What version are you using?

What is <string>?  Files that are #included normally have extensions, and
they're normally .h.

The normal course of these errors is if you've defined (not just declared) a
non-inline non-template function or initialised global data in a header file
instead of using a source file.  But why it's doing it with standard library
headers, I don't know.  Is it definitely not getting to something you've
written before reaching this stage?

Stewart.

--
My e-mail is valid but not my primary mailbox.
Please post replies on the 'group using Borland's server (forums.borland.com
or newsgroups.borland.com).
If you can't use Borland's servers, then please reply by e-mail, as I will
not receive messages posted on other servers.

Re:cannot generate pre compiled header


Ralf,

I have found the same thing - the STL header files cannot be put into
pre-compiled headers.  I haven't found any workaround other than avoid the
situation.

Dominic

Quote
"Ralf Treutel" <Ralf.Treu...@t-online.de> wrote in message

news:3a15d601_2@dnews...
Quote
> Hi,

> #include<string>
> will generate the error : "cannot generate pre compiled header : code in
> header"
> or, worse, with other STL files: "initilized data in header".
> Without pre-compiled headers, compile time will increase beyond what I can
> bear.
> Of course, I could do without the pc-headers but on the other hand : you
all
> must work with something suitable.

> I dont know if this was posted here before, but a search has not
> enlightened me...

> Any suggestions ?

Re:cannot generate pre compiled header


(my name changed with this posting...
 ... sorry for the inconvenience
)

Quote
> You could try being clearer about your problem.

> What version are you using?

BC 5.01 (german)

Quote
> What is <string>?  Files that are #included normally have extensions, and
> they're normally .h.

The STL (standard template library) is always included this way, please read about that in the help files...

Quote
> The normal course of these errors is if you've defined (not just declared) a
> non-inline non-template function or initialised global data in a header file
> instead of using a source file.  But why it's doing it with standard library
> headers, I don't know.  Is it definitely not getting to something you've
> written before reaching this stage?

No, definitely not my fault.
I have written some templates myself, including something like a std::vector.
Those files work with PCH, the Rogue Wave implementation will not.

Of course, we could use the Borland string class (include <cstring.h>) but my project forces me to use the STL.

Winnie

Re:cannot generate pre compiled header


Hi Dominic,

I think I remember a posting in this newsgroup about a jear ago, on the same topic.
However, that has been deleted by now (there isnt any archives, is there ?)

Quote
> I have found the same thing - the STL header files cannot be put into
> pre-compiled headers.  I haven't found any workaround other than avoid the
> situation.

How do you "avoid it" ?

Just dont use std::vector<MyClass> ??

Winnie

Re:cannot generate pre compiled header


I don't avoid using std::vector<MyClass>, I just avoid using it in headers I
have in the PCH.  Sort of a pain, but I have a fast computer, so the slow
down in compile speed is not a huge issue.

Dominic

Quote
"Thorsten Wienbarg" <win...@agatis.de> wrote in message

news:3A19D45A.21CF2B46@agatis.de...
Quote
> Hi Dominic,

> I think I remember a posting in this newsgroup about a jear ago, on the
same topic.
> However, that has been deleted by now (there isnt any archives, is there
?)

> > I have found the same thing - the STL header files cannot be put into
> > pre-compiled headers.  I haven't found any workaround other than avoid
the
> > situation.

> How do you "avoid it" ?

> Just dont use std::vector<MyClass> ??

> Winnie

Other Threads