Page 1 of 1

Error compiling with the new Clang 32bit compiler

Posted: Tue Sep 20, 2022 1:46 am
by 16491110
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

Re: Error compiling with the new Clang 32bit compiler

Posted: Tue Sep 20, 2022 7:21 pm
by yeray
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?

Re: Error compiling with the new Clang 32bit compiler

Posted: Wed Sep 21, 2022 7:00 am
by 16491110
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.

Re: Error compiling with the new Clang 32bit compiler

Posted: Wed Sep 21, 2022 7:29 am
by yeray
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.

Re: Error compiling with the new Clang 32bit compiler

Posted: Tue Sep 27, 2022 2:33 am
by 16491110
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.

Re: Error compiling with the new Clang 32bit compiler

Posted: Fri Oct 07, 2022 1:51 pm
by yeray
Hello,

Just found there's using namespace std; in "ENGINE\UNITS\_SeriesCache.h".
Removing that line, that error doesn't appear for me.

Re: Error compiling with the new Clang 32bit compiler

Posted: Mon Oct 10, 2022 11:14 am
by 16491110
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.

Re: Error compiling with the new Clang 32bit compiler

Posted: Thu Oct 13, 2022 1:55 pm
by yeray
Hello,

The best explanation I can find is in one of the comments in the issues above, here, from Bruneau Babet, dev at Embarcadero.