[Lazarus] Problem with JVM and/or native types

Sven Barth pascaldragon at googlemail.com
Thu Dec 29 13:23:08 CET 2011


On 29.12.2011 00:48, Mattias Gaertner wrote:
> On Thu, 29 Dec 2011 00:09:56 +0100
> Sven Barth<pascaldragon at googlemail.com>  wrote:
>> 1.) I have seen that you check for the define "JVM". Shouldn't this be
>> "CPUJVM" instead? (just asking)
>
> I changed them to CPUJVM.

That made a big improvement, thanks :)

>> 2.) If I e.g. click on the $include file at the bottom of the androidr14
>> unit (or any other converted unit that contains a "external" formal
>> class declaration) I still get the error message mentioned at (1) in my
>> old mail. The error location always appears at the first "external '...'
>> name '...'" location. [Other actions cause this error as well, not only
>> clicking on the include file name]
>
> I didn't have a jvm fpc yet. I simply played in the IDE.
> The above change should be sufficient.

The error with the first "external" class or interface declaration now 
has gone away, but I have found a new problem:

Ctrl+Clicking on an identifier that is declared in the AndroidR14 unit 
gives the following error:

### TCodeToolManager.HandleException: "Bezeichner nicht gefunden: 
TObject" at Line=2 Col=6 in 
"/mnt/data/source/fpc/fpc-jvm/rtl/android/jvm/androidr14.pas"

But there is no "TObject" at that position.

Also if I do this in a Java project instead of an Android one with an 
identifier that is declared in jdk15.pp then I get the following error:

### TCodeToolManager.HandleException: "Bezeichner nicht gefunden: 
TObject" at Line=17 Col=6 in 
"/mnt/data/source/fpc/fpc-jvm/rtl/java/system.pp"

Using an identifier that is declared in the system unit (JLObject) 
results in the same error.

Also a strange behavior: consider the following code:

=== example begin ===

   THelloWorld = class(OBPJJavaPlugin)
   private
     fLog: JULLogger;
     fFoo: OBPJJavaPlugin;
   public
     constructor Create;
     procedure onEnable;
     procedure onDisable;
     procedure onLoad; override;
   end;

=== example end ===

I can successfully Ctrl+Click the identifier inside the "class(...)", 
but I can not do that for the type of fFoo (see above mentioned error). 
I can also successfully do code completion in the class parent, but not 
for fFoo (if I do that for the type of fFoo then the code completion 
jumps to the above mentioned error location in system.pp, which is the 
"unit system;" line)

Nevertheless working with the JVM port is much easier now. Thank you 
very much :)

Regards,
Sven




More information about the Lazarus mailing list