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

Post Reply
Stefaan
Posts: 2
Joined: Thu Jun 20, 2019 4:22 am

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

Post by Stefaan » Fri Jun 21, 2019 9:42 am

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: 1956
Joined: Wed Oct 08, 2008 12:23 am

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

Post by jomitech » Fri Jun 21, 2019 11:44 am

Do you have the TwineCompile PCH Injection option turned off?
Jon

Stefaan
Posts: 2
Joined: Thu Jun 20, 2019 4:22 am

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

Post by Stefaan » Tue Jun 25, 2019 4:30 am

Do you mean the Use PCH file for each thread setting? This is off.

jomitech
Site Admin
Posts: 1956
Joined: Wed Oct 08, 2008 12:23 am

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

Post by jomitech » Mon Jul 01, 2019 2:49 pm

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

Post Reply