Page 1 of 1

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

Posted: Fri Jun 21, 2019 9:42 am
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.

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

Posted: Fri Jun 21, 2019 11:44 am
by jomitech
Do you have the TwineCompile PCH Injection option turned off?

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

Posted: Tue Jun 25, 2019 4:30 am
by Stefaan
Do you mean the Use PCH file for each thread setting? This is off.

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

Posted: Mon Jul 01, 2019 2:49 pm
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)

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

Posted: Sat Aug 03, 2019 11:35 am
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.

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

Posted: Tue Aug 20, 2019 7:32 am
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.

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

Posted: Mon Oct 21, 2019 9:00 pm
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.