BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PreCompiled Header
Goto page 1, 2  Next
 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Hamid
Guest





PostPosted: Sun Feb 26, 2006 4:03 pm    Post subject: PreCompiled Header Reply with quote



I forced that BCB 2006 generate and use precompiled header using a unique main header for all the application. But seemingly it dowsn't work properly, because BCB compiler is always counting a huge number codes for each unit. Why? I didn't have the same problem with BCB6.0. Is it a bug?
Back to top
Dennis Jones
Guest





PostPosted: Sun Feb 26, 2006 6:03 pm    Post subject: Re: PreCompiled Header Reply with quote



"Hamid" <hrz_mir (AT) Yahoo (DOT) com> wrote in message
news:4401c33b$1 (AT) newsgroups (DOT) borland.com...
Quote:

I forced that BCB 2006 generate and use precompiled header using a unique
main header for all the application. But seemingly it dowsn't work properly,

because BCB compiler is always counting a huge number codes for each unit.
Why? I didn't have the same problem with BCB6.0. Is it a bug?

Remember that if a header file contains initialized data, like math.h (or
DateUtils.h, which includes math.h), it cannot be pre-compiled. Therefore,
you have to be selective about which header files are included in the
pre-compiled header. Do you get any warnings about not being able to create
the pre-compiled header?

Are you using the #pragma hdrstop directive?

Did you give your pre-compiled header file a unique name?

- Dennis
Back to top
Hamid
Guest





PostPosted: Mon Feb 27, 2006 8:03 am    Post subject: Re: PreCompiled Header Reply with quote



I don't have any of headers that prevents BCB compiler from making precompiled headers. In my main header I have included:

#include <vcl.h>
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>

Moreover, BCB compiler doesn't give me any warning regarding this issue and still counts huge number of lines. Since my project includes many utints, it takes long that compiler compile it. I wonder why? you can test it yourself....

Thanx,
Hamid
Back to top
Dennis Jones
Guest





PostPosted: Mon Feb 27, 2006 5:03 pm    Post subject: Re: PreCompiled Header Reply with quote

"Hamid" <hrz_mir (AT) Yahoo (DOT) com> wrote in message
news:4402a393$1 (AT) newsgroups (DOT) borland.com...
Quote:

I don't have any of headers that prevents BCB compiler from making
precompiled headers. In my main header I have included:

#include <vcl.h
#include <Classes.hpp
#include <Controls.hpp
#include <StdCtrls.hpp
#include <Forms.hpp

Okay, what do your source files look like that include the precompiled
header?

Quote:
Moreover, BCB compiler doesn't give me any warning regarding this issue
and still counts huge number of lines. Since my project includes many

utints, it takes long that compiler compile it. I wonder why? you can test
it yourself....

I don't need to test it...I use pre-compiled headers too, and they work just
fine. Here's what I do:

First, I do not include vcl.h in my precompiled header file. Then in all of
my application source files, I include vcl.h and my precompiled header file
like this:

#include <vcl.h>
#include "MyPCH.h"
#pragma hdrstop

Another thing you should check is that you are including your pre-compiled
headers at the top of your source files *first* -- before any other header
files are included. In other words, do this:

#include "MyPCH.h"
#pragma hdrstop

#include "Unit1.h"


....*not* this:

#include "Unit1.h"

#include "MyPCH.h"
#pragma hdrstop

If you get this wrong, you will see the kind of behavior you are talking
about.

- Dennis
Back to top
hamid
Guest





PostPosted: Sun Mar 05, 2006 12:03 pm    Post subject: Re: PreCompiled Header Reply with quote

I have a unit which plays the role of a main header for me. In its cpp file I have lines below:

#include "MainUnit.h"
#pragma hdrstop
//-------------------------------------------------------------#pragma package(smart_init)
//-------------------------------------------------------------

and in its header I write:

#ifndef MainUnitH
#define MainUnitH
//-------------------------------------------------------------#include <vcl.h>
#include "mainFormUnit.h"

#endif
//-------------------------------------------------------------

All of my units (mainFormUnit.h for instance) includes this main header as:


#include "ServerMainUnit.h"
#pragma hdrstop
//-------------------------------------------------------------#pragma package(smart_init)
#pragma resource "*.dfm"
TmainForm *mainForm;
//-------------------------------------------------------------__fastcall TmainForm::TmainForm(TComponent* Owner)
: TForm(Owner)
{
}
//-------------------------------------------------------------

Clearly the header of my mainForm includes some other header files such as:

#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>

Now my question is why the pre-compiled header is not made? When you make the similar simple project in BCB6.0, it works well. That is to say BCB compiler counts exactly the number of lines which I write in a cpp file (mainFormUnit.cpp for example) not the huge amount of lines each time.
Back to top
hamid
Guest





PostPosted: Sun Mar 05, 2006 12:03 pm    Post subject: Re: PreCompiled Header Reply with quote

I meant MainUnit by ServerMainUnit. i.e they are as the same... It was my typing mistake in asking my question...
Back to top
Dennis Jones
Guest





PostPosted: Sun Mar 05, 2006 6:03 pm    Post subject: Re: PreCompiled Header Reply with quote

"hamid" <hrz_mir (AT) yahoo (DOT) com> wrote in message
news:440ac2dd$1 (AT) newsgroups (DOT) borland.com...
Quote:

I have a unit which plays the role of a main header for me. In its cpp
file I have lines below:


This is unnecessary. However, it isn't the cause of your problem.

Quote:
All of my units (mainFormUnit.h for instance) includes this main header
as:


#include "ServerMainUnit.h"
#pragma hdrstop
//-------------------------------------------------------------#pragma
package(smart_init)
#pragma resource "*.dfm"
TmainForm *mainForm;
//-------------------------------------------------------------__fastcall
TmainForm::TmainForm(TComponent* Owner)
: TForm(Owner)
{
}
//-------------------------------------------------------------

Clearly the header of my mainForm includes some other header files such
as:

#include <Classes.hpp
#include <Controls.hpp
#include <StdCtrls.hpp

Clearly? I don't see them anywhere! Where are they?


Quote:
Now my question is why the pre-compiled header is not made? When you make
the similar simple project in BCB6.0, it works well. That is to say BCB

compiler counts exactly the number of lines which I write in a cpp file
(mainFormUnit.cpp for example) not the huge amount of lines each time.

As shown, your code should probably work. However, it is clear that you are
*not* showing your actual code. You say that the header of mainForm
includes other headers, but you don't show that header nor do you show where
that header is #include'd. Please show all relevant portions of your code;
otherwise it is very difficult for anyone to offer help.

- Dennis
Back to top
hamid
Guest





PostPosted: Mon Mar 06, 2006 9:03 am    Post subject: Re: PreCompiled Header Reply with quote

Thanx for your reply. That would be great if you let me know an email address to send a short sample.
Back to top
Dennis Jones
Guest





PostPosted: Mon Mar 06, 2006 6:03 pm    Post subject: Re: PreCompiled Header Reply with quote

"hamid" <hrz_mir (AT) yahoo (DOT) com> wrote in message
news:440bf099$1 (AT) newsgroups (DOT) borland.com...
Quote:

Thanx for your reply. That would be great if you let me know an email
address to send a short sample.


It would be much better to post the relevant portions of your code here so
that everyone has a chance to offer help and all readers can benefit from
the discussion.

- Dennis
Back to top
hamid
Guest





PostPosted: Tue Mar 07, 2006 12:03 pm    Post subject: Re: PreCompiled Header Reply with quote

Ok! Simply create a VCL Form Application in both BCB6.0 and BCB2006. Then put the line of #include "Unit1.h" above #pragma hdrstop. You will see different actions from two compilers. BCB6.0 counts only 17 lines (the codes in CPP) after it creats the pre-compiled header, while BCB2006 is always counting huge amount of lines (almost 230,000 lines) in each compile. This issue frustrated me badly. Because it takes long time for me to compile my project. Why?
Back to top
Dennis Jones
Guest





PostPosted: Tue Mar 07, 2006 5:03 pm    Post subject: Re: PreCompiled Header Reply with quote

"hamid" <hrz_mir (AT) yahoo (DOT) com> wrote in message
news:440d6e71$1 (AT) newsgroups (DOT) borland.com...
Quote:

Ok! Simply create a VCL Form Application in both BCB6.0 and BCB2006. Then
put the line of #include "Unit1.h" above #pragma hdrstop. You will see

different actions from two compilers. BCB6.0 counts only 17 lines (the codes
in CPP) after it creats the pre-compiled header, while BCB2006 is always
counting huge amount of lines (almost 230,000 lines) in each compile. This
issue frustrated me badly. Because it takes long time for me to compile my
project. Why?

Perfect. Now someone with BDS2006 (which I don't) should be able to confirm
it. Alternatively, submit a QC report.

- Dennis
Back to top
Hamid
Guest





PostPosted: Wed Mar 08, 2006 8:03 am    Post subject: Re: PreCompiled Header Reply with quote

thanx. excuse me! but how can I report a QC report?
Back to top
Pete Fraser
Guest





PostPosted: Wed Mar 08, 2006 10:03 am    Post subject: Re: PreCompiled Header Reply with quote

go to qc.borland.com
or download jedqc which might be a nicer client.
HTH Pete

"Hamid" <hrz_mir (AT) Yahoo (DOT) com> wrote in message
news:440e803b$1 (AT) newsgroups (DOT) borland.com...
Quote:

thanx. excuse me! but how can I report a QC report?
Back to top
AJA
Guest





PostPosted: Wed Mar 08, 2006 11:03 am    Post subject: Re: PreCompiled Header Reply with quote

Or just in BDS2006 IDE choose Tools->QualityCentral

"Hamid" <hrz_mir (AT) Yahoo (DOT) com> píše v diskusním příspěvku news:440e803b$1 (AT) newsgroups (DOT) borland.com...
Quote:

thanx. excuse me! but how can I report a QC report?
Back to top
hamid
Guest





PostPosted: Sun Mar 12, 2006 7:03 am    Post subject: Re: PreCompiled Header Reply with quote

I remember that once you mentioned that pre-compiled headers of BDS2006 are working well in your IDE. Would you please let me know how you set up your settings? Or how are you including your header files? I am looking for a temporary solution for my problem.
thanx
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.