Error compiling with the new Clang 32bit compiler

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
NicQ
Newbie
Newbie
Posts: 4
Joined: Mon May 10, 2021 12:00 am

Error compiling with the new Clang 32bit compiler

Post by NicQ » Tue Sep 20, 2022 1:46 am

I have a large program, using C++Builder, that has been built over many years. Recently I compiled the program using RAD Studio 11.1 using the “traditional compiler” with no problems. I now need to compile using the latest Clang 32bit compiler. The problem is a compiler error relating to ...\windows\sdk/GdiplusPath.h.

The error message is in 2 parts. c:\program files (x86)\embarcadero\studio\22.0\include\windows\sdk/GdiplusPath.h(146,34): C++ error : reference to 'byte' is ambiguous
c:\program files (x86)\embarcadero\studio\22.0\include\windows\sdk\rpcndr.h(197,22): C++ error : > candidate found by name lookup is 'byte'
c:\program files (x86)\embarcadero\studio\22.0\include\windows\crtl\stddef.h(258,11): C++ error : > candidate found by name lookup is 'std::byte'

On checking Google the 2 lookups are functionally equivalent but nonetheless the Clang compiler sees it as an error.

The problem is almost certainly related to the TChart components, code not using TChart compiles without errors.

I am using TeeChart Pro v2022.35.220329 32bit VCL

Help please

Yeray
Site Admin
Site Admin
Posts: 9509
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Error compiling with the new Clang 32bit compiler

Post by Yeray » Tue Sep 20, 2022 7:21 pm

Hello,

I'm not able to reproduce the problem.
If you create a new project, it should use the Clang-enhanced compiler by default (ref).
I've created a new project, added a TChart to the form, and it seems to compile and run without issues.

Could you please specify it that happens with an old project or also with a new one?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

NicQ
Newbie
Newbie
Posts: 4
Joined: Mon May 10, 2021 12:00 am

Re: Error compiling with the new Clang 32bit compiler

Post by NicQ » Wed Sep 21, 2022 7:00 am

An old project. Developed incrementally over 15 plus years. If I had to rewrite from scratch I would be tempted to use Visual Studio.
I did build a toy project and didn't have the problem.
I can fix the error error on single components but it re-occurs on a project compile.

Yeray
Site Admin
Site Admin
Posts: 9509
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Error compiling with the new Clang 32bit compiler

Post by Yeray » Wed Sep 21, 2022 7:29 am

Hello,

This is what I find regarding the issue: RSP-25898, RSP-27292.
I can't find any using namespace std in TeeChart sources, so I'm not sure what can be wrong.

I'm trying to reproduce the problem so we can see if there's anything wrong at our side.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

NicQ
Newbie
Newbie
Posts: 4
Joined: Mon May 10, 2021 12:00 am

Re: Error compiling with the new Clang 32bit compiler

Post by NicQ » Tue Sep 27, 2022 2:33 am

I have created a new Toy project derived from the original program with dependencies removed and basically only header files remaining. On compiling the error occurs. The toy program uses TeeChart Pro. I have sent the program to Embarcadero but they don't have access to TeeChart Pro.
I tried to attach the Toy project (compressed) but it was too large at 13MB. I have removed further files so I hope it still shows the error.
Attachments
SE_TOY - Copy.zip
(25.21 KiB) Downloaded 224 times

Yeray
Site Admin
Site Admin
Posts: 9509
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Error compiling with the new Clang 32bit compiler

Post by Yeray » Fri Oct 07, 2022 1:51 pm

Hello,

Just found there's using namespace std; in "ENGINE\UNITS\_SeriesCache.h".
Removing that line, that error doesn't appear for me.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

NicQ
Newbie
Newbie
Posts: 4
Joined: Mon May 10, 2021 12:00 am

Re: Error compiling with the new Clang 32bit compiler

Post by NicQ » Mon Oct 10, 2022 11:14 am

It looks a likely solution. I will have to try on the complete program. Any thoughts on what is happening? I will pass your idea on to Embarcadero, maybe they will have some thoughts.

Yeray
Site Admin
Site Admin
Posts: 9509
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Error compiling with the new Clang 32bit compiler

Post by Yeray » Thu Oct 13, 2022 1:55 pm

Hello,

The best explanation I can find is in one of the comments in the issues above, here, from Bruneau Babet, dev at Embarcadero.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply