You are not logged in.
Hi,
I'm having issues trying to compile a delphi package that uses some units from mORMot2. I'm creating a component that is based on the suite but Delphi doesn't wanna compile it, it doesn't accept type = object for some reason. Detailed issue below:
I'm trying to create a package that creates a design-time component for mORMot2. Problem is, delphi keeps complaining about a type = object declaration on the code as shown in the image:
going through docwiki, I found out this segment that states object types are there only for backwards compatibility and shouldn't be used.
https://docwiki.embarcadero.com/RADStud … s_(Delphi)
In runtime the component works, it compiles and doesn't throw any errors, but if I try to create a .dpk to use the component in design time, then the package can't compile due to these errors, any Ideas on what I should do?
Last edited by Mobius1 (2023-09-08 21:28:43)
Offline
Welcome.
Which version of Delphi are you using?
So you confirm that the code compiles usually, but not when compiled as a .dpk?
It is pretty weird, and clearly a compiler issue.
Offline
11.3 Alexandria, but the same thing happens on 10.3.3 Rio, tested on this other version that I have installed here.
In runtime it compiles no problem, the .dpk throws the error. I want to create a design-time component using mORMot2, so for that It needs to compile in design-time as well... Asked on delphi global community about the issue but so far no one was able to help with the matter.
On lazarus it work like a charm, I have the component made beautifully, but on Delphi...
Offline
I have made a huge refactoring to use record whenever possible.
https://github.com/synopse/mORMot2/commit/e29d7f28
Embarcadero is not good at all about backward compatibility.
"object" is still relevant - because it is not of the same memory model than "class".
What I wrote at https://blog.synopse.info/?post/2010/08 … -hegemony! is still relevant
Offline
改动很大
Offline
Thanks! I will do some testing in a bit and will report the findings.
Offline
Got a few other definition errors on mormot.crypt.core.pas, will do the same {$IFDEF} directives you made on the other units and will send a PR with the adjustments, only 2 types were not treated.
Offline
Apparently everything is working as intended, if I stumble upon some other issue I'll open another topic, thanks for the workaround to bypass Delphi's bug.
Offline