Discussion:
bcc32pch - commandline compiler replace for buildin compiler
(too old to reply)
Andreas Hausladen
2005-09-01 12:36:21 UTC
Permalink
I have written a little plugin for C++Builder 6 (version 5 is not tested).
It replaces the buildin compiler by the command line tools.

Features:
- advanced precompiled header support (*)
- shows how many files already compiled
- batch compilation
- speed improvement (builtin compiler is not the fastest)
- full message pane support with extended error information (double click)
- detailed message window shows the console output

*: The plugin allows to inject a header file into all .cpp files during
compilation. In this header file you can include the headers that should
be used for precompiled headers. The #pragma hdrstop is inserted below the
injected include file.


Screenshots:
http://andy.jgknet.de/cpp/

Direct download:
http://andy.jgknet.de/cpp/files/bcc32pchide.zip

The zip files constains a precompiled plugin for BCB5 (untested) and BCB6.
The source code (Delphi) is included.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Luigi
2005-09-01 16:36:16 UTC
Permalink
Post by Andreas Hausladen
I have written a little plugin for C++Builder 6 (version 5 is not tested).
It replaces the buildin compiler by the command line tools.
Is it possible to use other command line compilers (e.g. MSVC), obviously for non-VCL projects?

Thank you,

Luigi
Andreas Hausladen
2005-09-01 17:06:37 UTC
Permalink
Post by Luigi
Is it possible to use other command line compilers (e.g. MSVC),
obviously for non-VCL projects?
The plugin uses the bpr2mak utility. And that creates a makefile for bcc32.
If you want another compiler you must write your own bpr2nmake tools.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Des O'Toole
2005-09-05 19:08:22 UTC
Permalink
Post by Andreas Hausladen
- advanced precompiled header support (*)
- shows how many files already compiled
- batch compilation
- speed improvement (builtin compiler is not the fastest)
- full message pane support with extended error information (double click)
- detailed message window shows the console output
Another feature

- Enables background compilation without any productivity loss.

Des
Rodrigo Gómez
2005-09-05 20:49:42 UTC
Permalink
Hello Andreas,

I've been trying to use this, but have experienced the following:

- Compiling the only EXE in my project group, ends in:
Hint: Cannot find file TS3_pch.h. I haven't created, that file, of
course, nor I want to create it. I already have my PCHs optimized (or that I
like to think! :-)). This could be because I have some spaces in the include
paths of the project, isn't?
- Trying to compile the other projects (wich are just packages) doesn't
seem to be calling the replacement, as I see the usual compiler dialog, and
I get the same old slow speed :-/.

Any idea? all the projects use more or less the same include path, and all
include the path with spaces, but I don't know if that could be the cause
for the second problem?
--
Rodrigo Gómez
www.rodrigogomez.com.mx/gallery/
Post by Andreas Hausladen
I have written a little plugin for C++Builder 6 (version 5 is not tested).
It replaces the buildin compiler by the command line tools.
- advanced precompiled header support (*)
- shows how many files already compiled
- batch compilation
- speed improvement (builtin compiler is not the fastest)
- full message pane support with extended error information (double click)
- detailed message window shows the console output
*: The plugin allows to inject a header file into all .cpp files during
compilation. In this header file you can include the headers that should
be used for precompiled headers. The #pragma hdrstop is inserted below the
injected include file.
http://andy.jgknet.de/cpp/
http://andy.jgknet.de/cpp/files/bcc32pchide.zip
The zip files constains a precompiled plugin for BCB5 (untested) and BCB6.
The source code (Delphi) is included.
--
Regards,
Andreas Hausladen
(http://andy.jgknet.de/blog)
Des O'Toole
2005-09-05 22:02:49 UTC
Permalink
Hi Rodrigo
Post by Rodrigo Gómez
Hint: Cannot find file TS3_pch.h. I haven't created, that file, of
course, nor I want to create it. I already have my PCHs optimized (or that
I like to think! :-)). This could be because I have some spaces in the
include paths of the project, isn't?
I think that's just a gentle reminder from the utility that you are not
using it's own version of PCH. I think you can safely ignore this.
Post by Rodrigo Gómez
- Trying to compile the other projects (wich are just packages) doesn't
seem to be calling the replacement, as I see the usual compiler dialog,
and I get the same old slow speed :-/.
The utility uses bpr2mak, I don't know if bpr2mak can handle .bpks or there
is a bpk2mak, but I imagine this is why it works as it does.

HTH

Des
Rodrigo Gómez
2005-09-06 00:26:37 UTC
Permalink
Hello Des!
Post by Des O'Toole
I think that's just a gentle reminder from the utility that you are not
using it's own version of PCH. I think you can safely ignore this.
Ok... but, If I'm seeing things correctly, that's stopping the process :-/
I'll need to check again this, but don't know if I can do it today. And BCB
doesn't make things any easier. :-|
Post by Des O'Toole
The utility uses bpr2mak, I don't know if bpr2mak can handle .bpks or
there is a bpk2mak, but I imagine this is why it works as it does.
bpr2mak handles correctly the bpks, as it's the one I'm using for instance
with ProjectMaker and mtbcc32.

Best regards,
--
Rodrigo Gómez
www.rodrigogomez.com.mx/gallery/
Post by Des O'Toole
Hi Rodrigo
Post by Rodrigo Gómez
Hint: Cannot find file TS3_pch.h. I haven't created, that file, of
course, nor I want to create it. I already have my PCHs optimized (or
that I like to think! :-)). This could be because I have some spaces in
the include paths of the project, isn't?
I think that's just a gentle reminder from the utility that you are not
using it's own version of PCH. I think you can safely ignore this.
Post by Rodrigo Gómez
- Trying to compile the other projects (wich are just packages)
doesn't seem to be calling the replacement, as I see the usual compiler
dialog, and I get the same old slow speed :-/.
The utility uses bpr2mak, I don't know if bpr2mak can handle .bpks or
there is a bpk2mak, but I imagine this is why it works as it does.
HTH
Des
Andreas Hausladen
2005-09-06 08:28:14 UTC
Permalink
Post by Rodrigo Gómez
Hint: Cannot find file TS3_pch.h. I haven't created, that file, of
course, nor I want to create it.
Please read the "Things you should know" section from
http://andy.jgknet.de/cpp/
Post by Rodrigo Gómez
- Trying to compile the other projects (wich are just
packages) doesn't seem to be calling the replacement,
as I see the usual compiler dialog, and I get the same old
slow speed :-/.
Package are not supported at the moment because for packages it IDE calls
other compiler functions which are not hooked at the moment. Maybe I can
have a look at them after wednesday.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Andreas Hausladen
2005-09-07 09:52:57 UTC
Permalink
It's wednesday: I have uploaded a new version which also replaces the
package compiler. (includes some minor bugfixes)

http://andy.jgknet.de/cpp
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Des O'Toole
2005-09-07 19:12:49 UTC
Permalink
Post by Andreas Hausladen
It's wednesday: I have uploaded a new version which also replaces the
package compiler. (includes some minor bugfixes)
Thanks for this Andreas,

You might want to be aware of small anomaly. For large projects the
make/build process divides the workload into several batches (ISTR this is
to do with a restriction of the amount of text that can be passed via the
command line). When using your utility, with the 'stop after file errors'
box unticked, if the build/make encounters an error it will only continue to
the end of that batch, not to the end of the project.

Also, could you tell me what the 'complete file modification check' tickbox
is for?

Thanks again.

Des
Andreas Hausladen
2005-09-07 19:29:51 UTC
Permalink
Post by Des O'Toole
When using your utility, with the 'stop after file
errors' box unticked, if the build/make encounters an error it will only
continue to the end of that batch, not to the end of the project.
Shouldn't be that hard to fix.
Post by Des O'Toole
Also, could you tell me what the 'complete file modification check'
tickbox is for?
The internal compiler calls a (internal) function which updates a TList of
file information data (age, dependencies, ...). With the compiler
replacement this function is not called. But without this function the IDE
always think you have changed the code while debugging and forces you to
recompile the project if you press F4, F7, F8, ...
The solution I found was to hook the TProjectUpdater.GetShouldBuild /
TPackageProjectUpdater.GetShouldBuild functions and return true if the
files have changed. Easier said then done. Testing the open Project files
for modifcations was no problem. But what's with stored files? Either I
open every .obj file and test for all "file dependency" comment chunks or
I invoke make.exe to do that for the whole project. But this could take a
while and make.exe is started for every F4, F7, F8, ... key. So I decided
to disable this function by default.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Des O'Toole
2005-09-07 22:37:00 UTC
Permalink
Post by Andreas Hausladen
The internal compiler calls a (internal) function which updates a TList of
file information data (age, dependencies, ...). With the compiler
replacement this function is not called. But without this function the IDE
always think you have changed the code while debugging and forces you to
recompile the project if you press F4, F7, F8, ...
The solution I found was to hook the TProjectUpdater.GetShouldBuild /
TPackageProjectUpdater.GetShouldBuild functions and return true if the
files have changed. Easier said then done. Testing the open Project files
for modifcations was no problem. But what's with stored files? Either I
open every .obj file and test for all "file dependency" comment chunks or
I invoke make.exe to do that for the whole project. But this could take a
while and make.exe is started for every F4, F7, F8, ... key. So I decided
to disable this function by default.
Thanks Andreas.

Are you updating the TList after every successful build or only when you
come to run the program? I ask this because I think (from memory) that if I
build, then try to run. it tries to run make again. This adds another
annoying pause. I will check this to make certain if you don't think this is
right.

Des
Andreas Hausladen
2005-09-07 22:51:38 UTC
Permalink
Post by Des O'Toole
Are you updating the TList after every successful build or only when you
come to run the program?
I do not update the list. I do not have access to this TList instance
because it is in bcbide60.bpl.
Post by Des O'Toole
I ask this because I think (from memory) that
if I build, then try to run. it tries to run make again.
Yes it starts make. If you run the program a "make project" is invoked
before the application starts. And that means that the plugin starts
make.exe.
Post by Des O'Toole
This adds another annoying pause. I will check this to make
certain if you don't think this is right.
I don't think I can do something against this except doing the
autodependent job in the plugin instead giving it to make.exe. But this
would reduce the pause only by the time "create process" needs to
initialize a new process.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Des O'Toole
2005-09-07 23:36:20 UTC
Permalink
Post by Andreas Hausladen
I do not update the list. I do not have access to this TList instance
because it is in bcbide60.bpl.
I see, I misunderstood.
Post by Andreas Hausladen
I don't think I can do something against this except doing the
autodependent job in the plugin instead giving it to make.exe. But this
would reduce the pause only by the time "create process" needs to
initialize a new process.
Could you implement a 'force run' feature that disables checking ?

Des
Andreas Hausladen
2005-09-07 20:44:51 UTC
Permalink
Do you thing it the "make project" speed would be improved if I add a
".cacheautodepend" to the makefile?
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Des O'Toole
2005-09-07 22:28:54 UTC
Permalink
Post by Andreas Hausladen
Do you thing it the "make project" speed would be improved if I add a
".cacheautodepend" to the makefile?
Hi Andreas

I've just ran it through a few times. Ignoring the first runs (which are
slower as they do not benefit from any disk caching) I get the following
timings:

without -c option: 4m:49s
with -c option: 4m:18s

so it would seem like a good idea/option.

Also I noticed that I don't actually use make.exe I use emake.exe which is a
wrapper around make.exe supplied by eurekalog to provide build in exception
handling. I don't know if you want to allow for alternative make programs or
if you suggest renaming them to be make.exe.

Des
Andreas Hausladen
2005-09-07 22:56:31 UTC
Permalink
Post by Des O'Toole
so it would seem like a good idea/option.
I'll add it (as option)
Post by Des O'Toole
Also I noticed that I don't actually use make.exe I use emake.exe which
is a wrapper around make.exe supplied by eurekalog to provide build in
exception handling. I don't know if you want to allow for alternative
make programs or if you suggest renaming them to be make.exe.
Does it support the -n parameter? If not I cannot support it. Otherwise I
could add another option.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Des O'Toole
2005-09-07 23:25:02 UTC
Permalink
Post by Andreas Hausladen
Post by Des O'Toole
Also I noticed that I don't actually use make.exe I use emake.exe which
is a wrapper around make.exe supplied by eurekalog to provide build in
exception handling. I don't know if you want to allow for alternative
make programs or if you suggest renaming them to be make.exe.
Does it support the -n parameter? If not I cannot support it. Otherwise I
could add another option.
According to "emake.exe ?" it appears to be a direct replacement. But why do
you need -n "Prints commands but does not do them" ?

Des
Andreas Hausladen
2005-09-07 23:36:11 UTC
Permalink
But why do you need -n "Prints commands but does not
do them" ?
I need it for the "complete dependency check" where I do not want to
compile anything if it was changed.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Andreas Hausladen
2005-09-13 12:21:18 UTC
Permalink
Post by Des O'Toole
You might want to be aware of small anomaly. For large projects the
make/build process divides the workload into several batches (ISTR this
is to do with a restriction of the amount of text that can be passed via
the command line). When using your utility, with the 'stop after file
errors' box unticked, if the build/make encounters an error it will only
continue to the end of that batch, not to the end of the project.
That's no anomaly. That is by design or better said there is no
possibility to prevent this. If I ignore bcc32's exit code and always
return 0, the make.exe will try to link the application which it should
not.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Andreas Hausladen
2005-09-08 00:42:12 UTC
Permalink
New features:
- Added alternative make.exe support
- Added "Force Run" menu item
- Added auto-dependency cache option for make.exe

Screenshots:
http://andy.jgknet.de/cpp/

Direct download:
http://andy.jgknet.de/cpp/files/bcc32pchide.zip
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Andreas Hausladen
2005-09-08 11:22:18 UTC
Permalink
As for BCB5, I tried installing it, but got an "Index out of bounds(-1)"
message.
I do not have BCB5, so testing it is not possible for me. And an
EListError could be everywhere you do not expect it. Maybe I find it by
guessing.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Jonathan Neve [Microtec]
2005-09-08 11:14:57 UTC
Permalink
Post by Andreas Hausladen
I have written a little plugin for C++Builder 6 (version 5 is not tested).
It replaces the buildin compiler by the command line tools.
Excellent work, and a very good idea!

I had thought of doing that too a while ago, but never got around to it.

I tested in BCB6, and it seems to work nicely (however I haven't been
able to test with a big project, because they are all in BCB5).

As for BCB5, I tried installing it, but got an "Index out of bounds(-1)"
message.
--
Best regards,
Jonathan Neve
_______________
CopyCat - advanced database replication
components for Delphi/C++Builder!
_______________________________________
e-mail: ***@microtec.fr
web : http://www.microtec.fr/CopyCat/index.html
Andreas Hausladen
2005-09-08 11:36:32 UTC
Permalink
As for BCB5, I tried installing it, but got an "Index out of bounds(-1)"
message.
This is now fixed. I tried to install the package into Delphi 5 and there
I got the same EListError. BCB5 does not have a "Run without Debugger"
menu item but I used this as index for the "Force Run" menu item.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Jonathan Neve [Microtec]
2005-09-08 12:19:42 UTC
Permalink
Post by Andreas Hausladen
This is now fixed. I tried to install the package into Delphi 5 and there
I got the same EListError. BCB5 does not have a "Run without Debugger"
menu item but I used this as index for the "Force Run" menu item.
Great, I'll give it a try later on, and tell you how it works. I can't
wait to try it with a big project! :)
--
Best regards,
Jonathan Neve
_______________
CopyCat - advanced database replication
components for Delphi/C++Builder!
_______________________________________
e-mail: ***@microtec.fr
web : http://www.microtec.fr/CopyCat/index.html
Muzaffar Mahkamov
2005-09-09 09:21:08 UTC
Permalink
Post by Andreas Hausladen
I have written a little plugin for C++Builder 6 (version 5 is not tested).
It replaces the buildin compiler by the command line tools.
Just installed on C++Builder 6 but it doesn't want to compile files that
have spaces in the path. e.g. for "C:\Program
Files\Borland\CBuilder6\Projects" it says "Could not find file
"Files\Borland\CBuilder6\Projects".

This error is returned by bcc32pch.exe.
Andreas Hausladen
2005-09-09 10:13:51 UTC
Permalink
Post by Muzaffar Mahkamov
This error is returned by bcc32pch.exe.
How old is your copy of bcc32pch.exe ?
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Muzaffar Mahkamov
2005-09-09 11:15:06 UTC
Permalink
Post by Andreas Hausladen
How old is your copy of bcc32pch.exe ?
I've just downloaded it. The modification date of bcc32pch.exe is
September 7, 2005.
Muzaffar Mahkamov
2005-09-09 11:38:12 UTC
Permalink
Post by Andreas Hausladen
How old is your copy of bcc32pch.exe ?
I did a clean build *using GExpers), created a precompiled header file
using the menu item in "projcts" and now it's working fine.
Andreas Hausladen
2005-09-09 12:05:40 UTC
Permalink
Post by Muzaffar Mahkamov
I did a clean build *using GExpers), created a precompiled header file
using the menu item in "projcts" and now it's working fine.
The actual problem is that the C++Builder IDE defines the $(BCB) symbol
with long path. The make files ignores it's own definition of $(BCB) if it
is already defined and so it used the long path instead of it's short
path. I'll add a "-UBCB" to every makefile call so this problem should be
history.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Muzaffar Mahkamov
2005-09-09 12:48:07 UTC
Permalink
Post by Andreas Hausladen
The actual problem is that the C++Builder IDE defines the $(BCB) symbol
with long path. The make files ignores it's own definition of $(BCB) if it
is already defined and so it used the long path instead of it's short
path. I'll add a "-UBCB" to every makefile call so this problem should be
history.
Thanks :) A very useful software.
One more question: is it possible to use MinGW (GNU) make? i just wanted
to give a try to "-j" (parallel make) option. I've tried to enter
"mingw32-make" as make.exe replacement and got an error saying -c, -H
and -O options are invalid.

Thanks in advance
Andreas Hausladen
2005-09-09 13:02:07 UTC
Permalink
Post by Muzaffar Mahkamov
One more question: is it possible to use MinGW (GNU) make?
If you write your own bpr2mak.exe that generates gnu make compatible
makefiles then this should work. But as long as there is no bpr2gmake or
gnu make is compatible to borland's make this is impossible.
Post by Muzaffar Mahkamov
to give a try to "-j" (parallel make) option. I've tried to enter
"mingw32-make" as make.exe replacement and got an error saying -c, -H
and -O options are invalid.
I do not call make.exe with -H or -O. This looks more that mingw32-make is
called when ever the compiler (bcc32) should be started.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Muzaffar Mahkamov
2005-09-09 13:20:47 UTC
Permalink
Post by Andreas Hausladen
If you write your own bpr2mak.exe that generates gnu make compatible
makefiles then this should work. But as long as there is no bpr2gmake or
gnu make is compatible to borland's make this is impossible.
I see. Sad :( I'll try to investigate gnu make syntax when i have time
and may be create a bpr2mak project :)

I don't know yet how bcc32pch works but i wish it would be parallelized
to take the advantage of multi-core and multi-processor systems by
running several instances of compiler :)
Andreas Hausladen
2005-09-09 13:29:48 UTC
Permalink
Post by Muzaffar Mahkamov
I don't know yet how bcc32pch works but i wish it would be parallelized
bcc32pch injects the PCH file into each .cpp file during compilation. A
parallel execution would lead to a problem with the compiler console
output. And some tests with mtbcc32 and fbcc32 showed that there is a case
where bcc32 stops working but does not terminate. It waits for something
until you kill it by hand with the task manager.
This lock does not happen very often but it happens and it is not
controllable.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Jonathan Benedicto
2005-09-09 16:20:16 UTC
Permalink
Post by Andreas Hausladen
And some tests with mtbcc32 and fbcc32 showed that there is a case
where bcc32 stops working but does not terminate. It waits for something
until you kill it by hand with the task manager.
This lock does not happen very often but it happens and it is not
controllable.
Maybe we should investigate this thoroughly and see if we can find a
solution. It seems very strange.

Jonathan
Andreas Hausladen
2005-09-09 13:24:22 UTC
Permalink
i just wanted to give a try to "-j" (parallel make) option.
Parallel execcution is not possible with precompiled headers. The bcc32
instances will depending on the timimg block each other or one stops using
PCHs.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Andreas Hausladen
2005-09-09 12:29:47 UTC
Permalink
Post by Muzaffar Mahkamov
This error is returned by bcc32pch.exe.
Should be fixed with the newest version.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Muzaffar Mahkamov
2005-09-09 13:59:52 UTC
Permalink
Post by Andreas Hausladen
I have written a little plugin for C++Builder 6 (version 5 is not tested).
It replaces the buildin compiler by the command line tools.
One more thing: it seems that bcc32pch changes .cpp file extensions to
uppercase (to *.CPP) after injecting pch. In my case TortoiseSVN
wouldn't recognize those *.CPP files as original *.cpp files until i
changed them to lowercase. It took me time, nerves and a restart to spot
this :) I think you should preserve the case of the filename when
injecting/removing the pch.
Andreas Hausladen
2005-09-09 14:13:36 UTC
Permalink
Post by Muzaffar Mahkamov
One more thing: it seems that bcc32pch changes .cpp file extensions to
uppercase (to *.CPP) after injecting pch.
It doesn't. It renames the original file by
-------------
BackupFilename := Filename + '_original.cpp';
RenameFile(Filename, BackupFilename);
-------------
writes a new file called <Filename> with the PCH header and the original
content, starts the compiler and restores the files by:
-------------
BackupFilename := Filename + '_original.cpp';
if FastFileExists(BackupFilename) then
begin
DeleteFile(Filename);
RenameFile(BackupFilename, Filename);
end;
-------------
I do not change any .cpp file extension string case.
Post by Muzaffar Mahkamov
wouldn't recognize those *.CPP files as original *.cpp files until i
changed them to lowercase.
Sorry for that but bcc32pch and the Plugin do not change the string case
of any extension. Maybe Windows's MoveFile() function does this on the
partition where you have stored the files but bcc32pch doesn't change this
intentionally. There is no Upper* or Lower* in the whole source code of
bcc32pch. And the plugin does not handle the files.

BTW: I would never add a uppercase CPP to any of my own files because I
hate upper case extensions.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Muzaffar Mahkamov
2005-09-09 14:40:59 UTC
Permalink
Post by Andreas Hausladen
Sorry for that but bcc32pch and the Plugin do not change the string case
of any extension. Maybe Windows's MoveFile() function does this on the
partition where you have stored the files but bcc32pch doesn't change this
intentionally. There is no Upper* or Lower* in the whole source code of
bcc32pch. And the plugin does not handle the files.
BTW: I would never add a uppercase CPP to any of my own files because I
hate upper case extensions.
Did a Build and monitored the directory for changes. As you mentioned,
some temporary files were created:

for about.cpp it had about.CPP_original.cpp

I think the problem is in the function where you retrieve the original
filename. I've checked *.bpr and *.bpr.xml and they have about.cpp, with
no caps.
Andreas Hausladen
2005-09-09 15:37:53 UTC
Permalink
Post by Muzaffar Mahkamov
I think the problem is in the function where you retrieve the original
filename.
I parse the command line in an own function which keeps the quotes intact.
And there I do not interpret any sub string.
Post by Muzaffar Mahkamov
I've checked *.bpr and *.bpr.xml and they have about.cpp, with
no caps.
And the bpr2mak generated .mak file?
--
Regards,

Andreas Hausladen
(http://www.kylix-patch.de.vu - unofficial Kylix 3 patches)
(http://andy.jgknet.de/blog)
Muzaffar Mahkamov
2005-09-09 16:27:48 UTC
Permalink
Post by Andreas Hausladen
And the bpr2mak generated .mak file?
yes, bpr2mak generates a correct makefile. the strange thing is that
when i run make in command line i see about.cpp. when i build in IDE, i
see about.CPP in message log bcc32pch gives me.
Olivier Bertini
2005-09-10 13:11:19 UTC
Permalink
Post by Muzaffar Mahkamov
One more thing: it seems that bcc32pch changes .cpp file extensions to
uppercase (to *.CPP) after injecting pch. In my case TortoiseSVN
wouldn't recognize those *.CPP files as original *.cpp files until i
changed them to lowercase. It took me time, nerves and a restart to spot
this :) I think you should preserve the case of the filename when
injecting/removing the pch.
The same happens to me.

Olivier
Andreas Hausladen
2005-09-10 16:37:31 UTC
Permalink
Post by Olivier Bertini
The same happens to me.
Are the filenames bcc32.exe outputs correct? Or do they have the
capitalized suffix?
Because the plugin uses those filenames to restore the files after they
are compiled so you can edit them without the problem that they are
restored after the whole compilation.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Andreas Hausladen
2005-09-10 17:22:57 UTC
Permalink
Post by Andreas Hausladen
Are the filenames bcc32.exe outputs correct? Or do they have the
capitalized suffix?
Because the plugin uses those filenames to restore the files after they
are compiled so you can edit them without the problem that they are
restored after the whole compilation.
I found the reason (while improving the auto-dependency)

It's this line in the makefile:
.PATH.CPP = $(PATHCPP)

If I change it to
.path.cpp = $(PATHCPP)

I get lower cased .cpp extensions. That means I must tweak the makefile.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Andreas Hausladen
2005-09-10 19:41:43 UTC
Permalink
I'll release a new version soon that fixes some issues:
- auto dependency for headers was lost (newer quote any path in the
makefile except in the call to the tools)
- .cpp -> .CPP problem.
- ignorance of any .c, .cc, .cxx file (where not compiled when in PCH mode)
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Andreas Hausladen
2005-09-10 17:24:15 UTC
Permalink
You might use FindFile to get the true names before renaming them.
A very good idea. I'll do this.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Bob Gonder
2005-09-10 17:18:30 UTC
Permalink
Post by Andreas Hausladen
Are the filenames bcc32.exe outputs correct? Or do they have the
capitalized suffix?
Because the plugin uses those filenames to restore the files after they
are compiled so you can edit them without the problem that they are
restored after the whole compilation.
It sounds like you are using the file names "as passed".
You might use FindFile to get the true names before renaming them.
Andreas Hausladen
2005-09-11 17:59:02 UTC
Permalink
There's a new version of the bcc32pch command line tool and the IDE plugin.

http://andy.jgknet.de/cpp
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Paw Suddergaard
2005-09-13 11:39:51 UTC
Permalink
Hi Great Tool!

in one of my projects i get this error:

Assertion failed DBUpdate\DBUpdateUnit.cpp(46) : right->exprTopType !=
T_VOID || x->exprTopType == T_VOID || ErrorMessageCount at
d:\helena\bcc\indep\xfold.c(2126)

I dont know that dir...


/Paw
Des O'Toole
2005-09-13 11:43:45 UTC
Permalink
Post by Paw Suddergaard
d:\helena\bcc\indep\xfold.c(2126)
I dont know that dir...
This is a Borland error message/dir, try googling to find out what is
causing it.

HTH

Des
Dave
2005-09-13 12:19:10 UTC
Permalink
Post by Andreas Hausladen
There's a new version of the bcc32pch command line tool and the IDE plugin.
Under BCB5 I get a "successful" compile no matter what, if I purposely
create a
syntax error I still get a successful compile and no errors.

Dave
Des O'Toole
2005-09-13 12:28:42 UTC
Permalink
Post by Dave
Under BCB5 I get a "successful" compile no matter what, if I purposely
create a
syntax error I still get a successful compile and no errors.
Has the modified file been saved to disk ?

Des
Dave
2005-09-13 12:35:05 UTC
Permalink
Post by Des O'Toole
Has the modified file been saved to disk ?
It asks me if I want to save and I say yes, even if I explicitly save
beforehand I get the same result.

Dave
Dave
2005-09-13 13:01:51 UTC
Permalink
Under bcc32pch Configuration I checked Detailed Message Dialog and now
instead of the Successful Compile message I'm getting a window with the
caption "Make" and the following messages:

Make Version 5.2 (c) 1997, 2000 Borland


C:\PROGRA~1\Borland\CBUILD~2\Bin\..\BIN\bcc32pch -showprocessid -pch="cbrad_
pch.h" -q -jb -02 -H=C:\PROGRA~1\Borland\CBUILD~2\Bin\..\lib\vcl50.csm -Hc -
Vx -Ve -X- -a8 -b- -k- -vi -c -tWM -w-par -I"C:\ORPHEUS\";"C:\PROGRA~1\Borla
nd\CBUILD~2\Bin\..\Include";C:\PROGRA~1\Borland\CBUILD~2\Bin\..\include\vcl"
;"C:\Program
Files\Cbuilder5\0dac\Include\";"C:\Codebase\CPP\source\" -D;_RTLDLL'NO_STRIC
T;USEPACKAGES -n .\cbradf.CPP
Hint: Cannot find file cbrad_pch.h
Error E2149: Could not find file
'Files\Borland\CBuilder5\0dac\Include";C:\Codebase\CPP\source" -D;_RTLDLL;NO
_STRICT;USEPACKAGES -n .\cbradf.CPP

So far as I'm aware this compiled Ok with the normal configuration. 0dac is
an Oracle database component that I'm not really using but the files are
there, Codebase files are also there.

I was assuming the pch file was optional?

Dave
Des O'Toole
2005-09-13 13:24:04 UTC
Permalink
Post by Dave
So far as I'm aware this compiled Ok with the normal configuration. 0dac is
an Oracle database component that I'm not really using but the files are
there, Codebase files are also there.
It might be worth double checking that the project is being saved too.
Post by Dave
I was assuming the pch file was optional?
That's right

Des
Andreas Hausladen
2005-09-13 14:22:23 UTC
Permalink
Post by Dave
I was assuming the pch file was optional?
It is. That's why it's a hint and no error.
Post by Dave
Error E2149: Could not find file
'Files\Borland\CBuilder5\0dac\Include";C:\Codebase\CPP\source"
-D;_RTLDLL;NO _STRICT;USEPACKAGES -n .\cbradf.CPP
Looks like another "path with spaces" bug. I thought I had fixed them all
in the plugin and in bcc32pch.exe. It becomes time to write an own
bpr2mak.exe :-)

I'm still waiting for the first "command line too long" error that lot's
of people report when compiling the JVCL.


Another bug you found is that the tool does not stop when there is "Error
Exxxx: no-filename".
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Andreas Hausladen
2005-09-13 14:42:38 UTC
Permalink
-I"C:\ORPHEUS\";"C:\PROGRA~1\Borland\CBUILD~2\Bin\..\
Include";C:\PROGRA~1\
[...]
There's a " missing. This inverts all other quotes. And so the compiler
sees "Files\..." as file name and not as part of the include (-I) argument.
The code that adds the quotes is very simple and I cannot see the bug
there because if I quote a include directory then I prepend and append a
quotation char. So they always come in a double pack.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Dave
2005-09-13 13:17:11 UTC
Permalink
I went under Project/Options/Directories/Conditionals and there were paths
in there to the Odac stuff. I deleted these and it's now working
properly... and it's very cool!
Harald Plontke
2005-09-14 07:51:13 UTC
Permalink
Hello Andreas,
Post by Andreas Hausladen
I have written a little plugin for C++Builder 6 (version 5 is not tested).
It's a fantastic tool. I waited for this, since BCB exists (The builtin
Backgroundcompilation of BCB is unusable). There was a tool
"backgroundexpert" for BCB4, which was a good beginning, but it did not
support the message window.

Unfortunately with bcc32pch installed I get an Access violation when BCB
starts and several at closing. Nevertheless your plugin functioned, but I
lost the IDE-Shortcuts from GExpert and Autosave Desktop at closing BCB
doesn't function anymore.

If you like, I can send you screenshots of the errormessages.

As thirdparty components I have installed:

GExperts, TColorSpeedButton, TDBValComboBox, TQRMyImage, TSelectComboBox,
TEvent_Protokoll

Greetings,

Harald
Andreas Hausladen
2005-09-14 09:45:18 UTC
Permalink
Post by Harald Plontke
If you like, I can send you screenshots of the errormessages.
The usual Windows access violation message boxes say nothing I could use.
Post by Harald Plontke
GExperts, TColorSpeedButton, TDBValComboBox, TQRMyImage, TSelectComboBox,
TEvent_Protokoll
What happens if you deactivate them one by one?

I have GExperts installed and no problem with bcc32pch.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Harald Plontke
2005-09-14 13:25:12 UTC
Permalink
This post might be inappropriate. Click to display it.
Andreas Hausladen
2005-09-14 15:02:56 UTC
Permalink
Post by Harald Plontke
Package C:\Programme\Borland\CBuilder6\Bin\bcc32pchPlugin60.bpl kann
nicht geladen werden. Access violation at address 066F... Read of
address 000... Soll dieses Package beim Laden des nächsten Projekts
geladen werden?" (Package xxx can not be loaded...)
Could you download the newest version. I've added a BCB6 package to it so
you can debug it.

1. Remove the bcc32pch package from the IDE.
2. Close all projects and open the ide/source/bcb/bcc32pch.bpk file
3. Adjust the "Run/Parameters" (Start/Parameter...") Host application to
"C:\WhereBCBis\Bin\bcb.exe /ns"
4. "Start" the package (the second BCB instance will show up)
5. Place a Breakpoint in the bcc32pch_Main.pas in line 293
(TBcc32PchNotifier.Create).
6. Add the bcc32pchPlugin60.bpl package to the second instance. (the
breakpoint should be hit)
7. Step through the code and find the function that causes the AV
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Harald Plontke
2005-09-14 19:06:01 UTC
Permalink
Hello,
Post by Andreas Hausladen
Could you download the newest version. I've added a BCB6 package to it so
you can debug it.
I will do this. Unfortunately it seems, my BCB is broken, after more AVs I
cannot start programs in the debugger anymore, I get AV at every attempt to
start "MyProject".exe from within the IDE. Before that, I had the behaviour,
that on every "step over" in the debugger the IDE asks for "sourcecode has
changed, will you recompile", which was not from the beginning, when I
installed bcc32pch. It seems I had to reinstall BCB. I removed your package
from the IDE, but the error remains.
The "MyProject".exe runs fine, if I start it outside the IDE.
I am on a bussines trip for the rest of the week, but I will try to debug
your package next week.

Greetings,

Harald
Harald Plontke
2005-09-21 09:29:28 UTC
Permalink
Hello Andreas,

today I tried to compile the bcc32pchPlugin.bpk, but I get

[Pascal Fataler Fehler] bcc32pch_Main.pas(17): Datei nicht gefunden:
'ToolsAPI.dcu'
[Linker Fataler Fehler] Fatal: Unable to open file 'BCC32PCH_MAIN.OBJ'

I will now try the debugversion.

Harald
Harald Plontke
2005-09-21 09:51:58 UTC
Permalink
Hello,

i tried the debugversion so far:

The acessviolations at exit of BCB are gone.
The acessviolation at startup BCB still remains, the autosave desktop will
not be loaded und the GExperts Shortcuts are still gone. Opening the
GExperts IDE-Shortcut window for one time reassignes the shortcuts.

Also in debuggermode at every "step over" I get the "sourcecode has
changed"-message, even there was no change in the code.

How can I use the debugversion? I just get the same errormessage at the
start of BCB.

Greetings,

Harald
Harald Plontke
2005-09-21 09:55:24 UTC
Permalink
Post by Harald Plontke
The acessviolations at exit of BCB are gone.
after four times starting und exiting BCB the first AV comes back.
Andreas Hausladen
2005-09-21 10:49:38 UTC
Permalink
Post by Harald Plontke
How can I use the debugversion?
The only difference to the release version is that the JCL Debug exception
handler is installed and that there is a .map file which is used to print
the stack trace. But this advanced exception dialog apperas only if the
exception is in the plugin.
Post by Harald Plontke
Also in debuggermode at every "step over" I get the "sourcecode has
changed"-message, even there was no change in the code.
Are there files which are marked as modified? If yes then that is the
reason. I can only deactivate the whole test for the "source code has
changed" dialog and ignore any file modification.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Harald Plontke
2005-09-21 12:05:48 UTC
Permalink
Hello,
Post by Andreas Hausladen
Are there files which are marked as modified? If yes then that is the
reason.
All files are saved and a "rebuild all" was just executed sucessfully.
With the BCB internal compiler there is no "source code has
changed"-message. What do you mean with "marked as modified"?
Post by Andreas Hausladen
I can only deactivate the whole test for the "source code has
maybe this is an option (because it annoyed me anyway)

btw. Do you have any idea, why i do not have this 'ToolsAPI.dcu' to compile
the package? There is a file ToolAPI.pas present in my
"C:\Programme\Borland\CBuilder6\Source\Toolsapi" directory,
so shouldn't there be a ToolsAPI.dcu file?

Greetings,

Harald
Andreas Hausladen
2005-09-21 12:14:12 UTC
Permalink
Post by Harald Plontke
What do you mean with "marked as modified"?
If you change a line in an opened file the editor buffer is marked as
modified until you save it to disk.
Post by Harald Plontke
maybe this is an option (because it annoyed me anyway)
I thought I should keep this "feature" as you can see that you have
changed the code and the maybe you want to recompile the project.
Post by Harald Plontke
btw. Do you have any idea, why i do not have this 'ToolsAPI.dcu' to
compile the package?
Because it is a design time unit and Borland ships it in the designide.dcp
package.
Post by Harald Plontke
There is a file ToolAPI.pas present in my
"C:\Programme\Borland\CBuilder6\Source\Toolsapi" directory,
so shouldn't there be a ToolsAPI.dcu file?
No, because it is compiled into designide.dcp.
But I found out that bpr2mak.exe does not generate the correct dcc32.exe
command line options. For example it ignores the "used packages" and so
there is no designide specified package to compile against. I fixed but I
haven't released it yet. So you should uninstall the plugin, compile the
bpk file and reinstall the plugin (in a second BCB instance started from
the first BCB instance (Run/Parameters...) ).
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Harald Plontke
2005-09-21 19:37:42 UTC
Permalink
Hello,
Post by Andreas Hausladen
I thought I should keep this "feature" as you can see that you have
changed the code and the maybe you want to recompile the project.
The problem is, I have not changed any code.
Anyway, I think the feature is useful at the "run"-Command, but not at "Step
over" or "Trace into".

Greetings,

Harald
Andreas Hausladen
2005-09-21 21:52:28 UTC
Permalink
Post by Harald Plontke
The problem is, I have not changed any code.
Anyway, I think the feature is useful at the "run"-Command, but not at
"Step over" or "Trace into".
But that's the time when the IDE invokes the test for modified files. I'll
remove this code (at least for the open files).
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Andreas Hausladen
2005-09-14 13:38:39 UTC
Permalink
I've uploaded a new version to
http://andy.jgknet.de/cpp/

You must replace both the plugin and bcc32pch.exe by the new one.

Changes:
# Fixed endless loop in splitting -I command line option.
# Errors without a filename in the message are now recognized as errors.
# Added bcc32.exe replacement option.
# Secured plugin unload code.
# Message/Compile dialog auto closes when starting the application.
# bcc32pch can show the bcc32's command line.
--
Regards,

Andreas Hausladen
(http://andy.jgknet.de/blog)
Loading...