Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation of Synedit component under C++ Builder leads to error #213

Open
matdev2022 opened this issue Mar 25, 2022 · 2 comments
Open
Labels

Comments

@matdev2022
Copy link

When I try to install Synedit using Getit, I get an error message during the installation:

synedit
synedit-2
Unable to open file 'designide.bpi'.
However, this happens only for the Win64 version of the SynEditCR project.
The 32bit version is installed without problems.

If a new 32 bit - project is created and the SynEdit main component is put on a new form, an error occurs when compiling the project:

SynDWrite.hpp: unknown type name '_di_IDWriteFactory'.

Thereupon I have cloned the Synedit project with Fork and made the following adjustments:

SynDWrite.pas line 135 {$EXTERNALSYM IDWriteFactory} was commented out.
Then the missing type was generated in SysDWrite.hpp.
#153

In order to solve the error during the installation of the component, I have made the following changes:

Project: SynEditCD280.bpl
The 64 bit version was removed as the target platform.

Project: SynEditCR280.bpl
The 32 and 64 bit version still exist as target platforms.
The required BPI, designide.bpi and designideresources.bpi were removed.

Since I have almost no knowledge of Delphi, I do not know if the changes I have made are OK, but everything works for me now.
I have tested the changes with the C++ Builder 11.1 Professional.

@ogsadmin
Copy link

ogsadmin commented Apr 5, 2022

Thanks for sharing - I had a similar issue here. I managed to get it working (based your hints, thanks), but also digged out the actual reason (see below).

For me, installing the current version from GetIt (SynEdit VCL 2022.03) finished successfully (after using the correct version for C++Builder, see #216), but using it (drop a TSynEdit onto a form and build) failed with a similar error:
image

Strange thing was, that the missing type _di_IDWriteFactory was correctly declared in Winapi.D2D1.hpp (which is correctly included from SynDWrite.hpp), but still not recognized by the Alexandria 11.1 CLang 32 compiler. Also funny that -click jumps to the declaration, so CodeInsight seems to resolve the symbol, whereas the clang compiler does not...

This made me look a bit more into the details - and I stumbled over the missing namespace decoration in the generated SynDWrite.hpp file. Although the lines before and after the error use the full namespace qualifier Winapi::D2d1::, the error line does not (even though it is defined in the same Winapi.D2D1.hpp and thus in the same namespace):
image

So the correct fix is to add the namespace prefix and voila, it builds:
image

I am not deep into the Delphi world, too, but to me it smells like the hpp generator has a bug.

@ogsadmin
Copy link

ogsadmin commented Apr 5, 2022

FYI: I've filed a bug report with embarcadero: https://quality.embarcadero.com/browse/RSP-37899.

@pyscripter pyscripter added the C++ label Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants