Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2019-04

problems while compiling androidr14.inc

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mgr. Janusz Chmiel

Please do you think, that this Free Pascal compiler error indicates, that some part of androidR14.inc unit have been compiled incorrectly? C:\javavcl-code-1007\fpc\units\jvm-android\rtl\androidr14.inc(2750,15) Hint: (3274) Inherited methods can only be overridden in Objective-C and Java, add "override" (inherited method defined in JLObject). Or it is OK and resulting classes will be correct and code will run? Thank you very much for yours explanation.

Jonas Maebe
to Mgr. Janusz Chmiel
Mgr. Janusz Chmiel wrote 6 lines
Please do you think, that this Free Pascal compiler error indicates, that some part of androidR14.inc unit have been compiled incorrectly? C:\javavcl-code-1007\fpc\units\jvm-android\rtl\androidr14.inc(2750,15) Hint: (3274) Inherited methods can only be overridden in Objective-C and Java, add "override" (inherited method defined in JLObject). Or it is OK and resulting classes will be correct and code will run?

It is fine.

These are only declarations for external classes. The tool that generates the declarations for the external classes cannot determine whether a method is new or inherited from a parent class, so it always adds "virtual" instead of "override" in case it's an overriding method. That is where the hint comes from. The actual classes are implemented in Java/Dalvik and part of the Android class libraries, and are correct.

If you would do the same with a class implemented in Pascal, then the compiler would print an error instead of a hint, because then the compiled code would not work as expected.

Jonas