TwineCompile gives compiler errors when using "Inject precompiled header file"

TwineCompile - Cut C++Builder compile times by up to 50x!
Post Reply
Stefaan
Posts: 3
Joined: Thu Jun 20, 2019 4:22 am

TwineCompile gives compiler errors when using "Inject precompiled header file"

Post by Stefaan »

I'm using C++ builder Rio 10.3.1 with the clang compiler. The compiler has an option to inject a header file before each source file to make sure all files use the same precompiled header. This option can be found in the project options under Building > C++ Compiler > Pre-compiled headers: Inject precompiled header file.

When creating a new project, a header is auto-generated with this content:

Code: Select all

#include <vcl.h>
#include <tchar.h>
When I set this option to the auto-generated header (Project2PCH1.h), I get the following errors while compiling:

Code: Select all

[C++ Error] Project2PCH1.h(1, 12):  #include nested too deeply
[C++ Error] Project2PCH1.h(1, 9):  #include nested too deeply
[C++ Error] Project2PCH1.h(2, 9):  #include nested too deeply
[C++ Error] vcl.h(10, 9):  #include nested too deeply
[C++ Error] tchar.h(15, 9):  #include nested too deeply
[C++ Error] tchar.h(37, 9):  #include nested too deeply
[C++ Error] tchar.h(703, 8):  unknown type name '_WINT_T'
This works correctly using the classic compiler, it only gives the errors with the clang compiler. It also compiles fine when TwineCompile is disabled.
jomitech
Site Admin
Posts: 2175
Joined: Wed Oct 08, 2008 12:23 am

Re: TwineCompile gives compiler errors when using "Inject precompiled header file"

Post by jomitech »

Do you have the TwineCompile PCH Injection option turned off?
Jon
Stefaan
Posts: 3
Joined: Thu Jun 20, 2019 4:22 am

Re: TwineCompile gives compiler errors when using "Inject precompiled header file"

Post by Stefaan »

Do you mean the Use PCH file for each thread setting? This is off.
jomitech
Site Admin
Posts: 2175
Joined: Wed Oct 08, 2008 12:23 am

Re: TwineCompile gives compiler errors when using "Inject precompiled header file"

Post by jomitech »

Can you send the twfiles.@@@ file from the project directory to support at jomitech dot com? Also send the complete build window output when TwineCompile is disabled (to get the IDE's configuration)
Jon
jomitech
Site Admin
Posts: 2175
Joined: Wed Oct 08, 2008 12:23 am

Re: TwineCompile gives compiler errors when using "Inject precompiled header file"

Post by jomitech »

Thanks for the files. Sorry for the delay in responding. I cannot see any difference in the compiler options that the IDE or TwineCompile is providing to the bcc32 CLANG compiler.

Which file fails to compile with those errors? Also, I'd suggest deleting the existing compiled obj files and the compiled .pch file and trying again.
Jon
Stefaan
Posts: 3
Joined: Thu Jun 20, 2019 4:22 am

Re: TwineCompile gives compiler errors when using "Inject precompiled header file"

Post by Stefaan »

I get the error on the Project1PCH1.h header itself. Clearing the debug folder doesn't make a difference.

I have attached a test project which gives the error.

Ps. mail notifications for replies don't seem to work on the forum.
Attachments
Project1.zip
(56 KiB) Downloaded 1063 times
jomitech
Site Admin
Posts: 2175
Joined: Wed Oct 08, 2008 12:23 am

Re: TwineCompile gives compiler errors when using "Inject precompiled header file"

Post by jomitech »

Please accept my apologies for the delay in responding to this issue. Thanks for the test project, it made diagnosing and fixing this issue much simpler.

Please download the fix from http://jomitech.com/downloads/mtbcc32.zip and extract into the TwineCompile Program Files directory.
Jon
Post Reply