Page 1 of 3

Help wanted to solve compiler errors with CLANG 32-bit

PostPosted: Wed Aug 10, 2016 3:49 am
by Geocentrix
Hi

I am attempting to port an existing C++Builder application from the 32-bit 'classic' compiler (BCC.exe) to the 32-bit CLANG compiler (CLANG.EXE), using RAD Studio 10 Seattle.

I am using TDMTextTarget and TDMTextSource components on a form and so the header file "DMComps.hpp" is included automatically in the form's header file.

When I compile with BCC.exe I get no errors. When I compile with CLANG I get:

Code: Select all
[CLANG Error] systobj.h(287): static_cast from 'IAsyncOperation *' to 'IUnknown *' is not allowed
[CLANG Hint] DMComps.hpp(297): in instantiation of member function 'System::DelphiInterface<IAsyncOperation>::~DelphiInterface' requested here
[CLANG Error] systobj.h(264): member access into incomplete type 'IAsyncOperation'
[CLANG Hint] DMComps.hpp(299): in instantiation of member function 'System::DelphiInterface<IAsyncOperation>::DelphiInterface' requested here
[CLANG Hint] Winapi.ShlObj.hpp(324): forward declaration of 'IAsyncOperation'
[CLANG Hint] Winapi.ShlObj.hpp(44): expanded from macro 'DECLARE_DINTERFACE_TYPE_UUID'


Is this a known error with DropMaster and CLANG?

Is there a solution?

Thanks in anticipation.

Andrew Bond

Re: Help wanted to solve compiler errors with CLANG 32-bit

PostPosted: Thu Aug 11, 2016 11:33 am
by Raize Support
Hi Andrew,

Thanks for the report. The DropMaster components are written in Delphi, and the header file and associated object/lib files are produced by Delphi compiler using certain command line parameters. It would appear from your message that the C++ export support from the Delphi compiler is not producing CLANG compatible output. We are contacting Embarcadero to determine if there is anything that can be done on our end to resolve this.

Ray

Re: Help wanted to solve compiler errors with CLANG 32-bit

PostPosted: Tue Aug 30, 2016 7:08 am
by Geocentrix
Raize Support wrote:We are contacting Embarcadero to determine if there is anything that can be done on our end to resolve this.


Ray, do you have any further information on this, please?

Andrew

Re: Help wanted to solve compiler errors with CLANG 32-bit

PostPosted: Wed Aug 31, 2016 12:19 am
by Raize Support
Hi Andrew,

We have received some information from Embarcadero R&D, and unfortunately, there is no easy solution. The basic problem is that Microsoft renamed the IAsyncOperation to IDataObjectAsyncCapability. The correct fix is to rename IAsyncOperation to IDataObjectAsyncCapability in ShlObj.pas. The problem is that this is an interface change and can only be performed with a new release of RAD Studio. As an alternative, the DropMaster components could define the IDataObjectAsyncCapability interface, but this is problematic because the interface is not supported in all versions of windows. Unfortunately, we have not come to a decision on the best approach for this particular issue.

Ray

Re: Help wanted to solve compiler errors with CLANG 32-bit

PostPosted: Fri Sep 02, 2016 7:23 am
by Geocentrix
Raize Support wrote:The problem is that this is an interface change and can only be performed with a new release of RAD Studio ... we have not come to a decision on the best approach for this particular issue


Ray

Thanks for the explanation. So that I am clear what my options are, would you please confirm my current understanding of the situation:

  • DropMaster does NOT work with C++Builder 10 Seattle Update 1
  • DropMaster should work with C++Builder 10.1 Berlin???

Thanks

Andrew

Re: Help wanted to solve compiler errors with CLANG 32-bit

PostPosted: Sat Sep 03, 2016 10:09 am
by Raize Support
The CLANG compiler issue with the IAsyncOperation affects both Seattle and Berlin. The BCC compiler should work fine for both.

There does appear to be an issue with Seattle Update 1 regarding runtime packages. We are investigating this.

Ray

Re: Help wanted to solve compiler errors with CLANG 32-bit

PostPosted: Mon Sep 05, 2016 3:01 am
by Geocentrix
Raize Support wrote:The CLANG compiler issue with the IAsyncOperation affects both Seattle and Berlin. The BCC compiler should work fine for both.


Ray

Thanks for your reply.

Has the IAsyncOperation bug been reported to Embarcadero (do you have a QC number)? Do you know if it is scheduled to be fixed in the next update (if it is a Microsoft-created interface change)?

We are in the process of poting our commercial applications from C++Builder 2007 32-bit to C++Builder 10.1 Berlin 32-bit and so this bug makes DropMaster unusable for us. It would be good to know that this is just a temporary situation.

Andrew

Re: Help wanted to solve compiler errors with CLANG 32-bit

PostPosted: Thu Dec 22, 2016 4:06 pm
by Geocentrix
This is a follow up on the status of this bug in DropMaster.

I have now ported my code to RADStudio 10.1 Berlin Update 2 and I still get the compiler error:

[C++ Error] systobj.h(289, 14): member access into incomplete type 'IAsyncOperation'
[C++ Error] DMComps.hpp(297, 22): in instantiation of member function 'System::DelphiInterface<IAsyncOperation>::~DelphiInterface' requested here


This has made DropMaster totally unusable with RADStudio since the Seattle release. I expected Raize to be more proactive in persuading Embaracadero to fix this issue (if it is, in fact, a problem within Embarcadero's jurisdiction).

Please can someone from Raize tell me the QC number for this issue in Embarcadero's bug-tracking system? Or can someone provide a practical workaround to the problem?

I am running the latest release of DropMaster (2.4.7).

According to the press release dated on 1 May 2016 posted on Raize's own website, here
http://www.raize.com/DevTools/Default.asp:

"DropMaster and Inspex Now Support RAD Studio 10.1 Berlin
"Raize Software is pleased to announce the immediate availability of DropMaster 2.4.7
"All products have been updated to include support for Embarcadero RAD Studio 10.1 Berlin. The new builds are free for all registered users of the respective products."


However, it appears that support for RAD Studio 10.1 Berlin is limited.

Re: Help wanted to solve compiler errors with CLANG 32-bit

PostPosted: Wed Jan 04, 2017 2:36 am
by Geocentrix
Please may I have a reply to my previous post, since I am unable to use DropMaster at present.

Re: Help wanted to solve compiler errors with CLANG 32-bit

PostPosted: Sun Jan 08, 2017 12:43 am
by Raize Support
Hi,

I apologize for the lack of response to your issue. It is not that we are ignoring the problem, its just that there is really no easy solution without Embarcadero's involvement. I should have provided a more detailed response earlier regarding what exactly is causing the issue. Let me do that now.

While our lack of response does not reflect what has happened, we have been in contact with the engineers at Embarcadero regarding this issue. The root cause of the problem is that Microsoft changed the name of the IAsyncOperation interface. Yes, they actually renamed the interface to IDataObjectAsyncCapability. The GUID associated with the COM interface is the same but the name is different. But more importantly, this means that there is no definition for IAyncOperation in C++. This results in the CLANG compiler complaining about an incomplete type, when compiling the conversion operator for the TTextDataObject class.

According to Embarcadero, the correct fix is to rename the IAsyncOperation interface to IDataObjectAsyncCapability in ShlObj.pas (and create a weak alias for backward compatibility). However, that would require an interface change to Winapi.ShlObj.pas, which is not allowed except for a major release. That is, this cannot be done in an update, which is why it could not be included in Berlin Update 2. Another option would be to NOT mark IAsyncOperation as $EXTERNALSYM, but that too is also an interface change.

We have tried a couple possible workarounds within the DropMaster code, but so far none have proven to be successful. We are engaging Embarcadero again to see if we can resolve some of the issues we are having with the workaround.

I am sorry that I cannot share more positive news.

Ray