Re: [Lazarus] Problem with JVM and/or native types
On 03.01.2012 18:30, Mattias Gaertner wrote: On Thu, 29 Dec 2011 13:23:08 +0100 Sven Barthpascaldra...@googlemail.com wrote: [...] ### 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. It seems JLObject is the base class for target jvm. I added that information to codetools. And that seems to have solved all remaining problems. Now Lazarus is usable for FPC JVM development. Thank you very much Matthias :) Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem with JVM and/or native types
On Thu, 29 Dec 2011 13:23:08 +0100 Sven Barth pascaldra...@googlemail.com wrote: [...] 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. TObject is the default ancestor of a class. It does not need to be written in code. It works here. Clicking on what identifier? 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. It works here. But I don't have a working jvm compiler, so maybe it has some special defines. Also a strange behavior: consider the following code: === example begin === THelloWorld = class(OBPJJavaPlugin) Where is OBPJJavaPlugin defined? 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 :) Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem with JVM and/or native types
On Thu, 29 Dec 2011 13:23:08 +0100 Sven Barth pascaldra...@googlemail.com wrote: [...] ### 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. It seems JLObject is the base class for target jvm. I added that information to codetools. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem with JVM and/or native types
On 29.12.2011 00:48, Mattias Gaertner wrote: On Thu, 29 Dec 2011 00:09:56 +0100 Sven Barthpascaldra...@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 -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem with JVM and/or native types
On Sun, 25 Dec 2011 14:26:02 +0100 Sven Barth pascaldra...@googlemail.com wrote: Hello together! I'm currently experimenting with the JVM port and I have a problem when navigating a source file of mine (Lazarus revision 34392). The problematic locations are marked with // (number) of which the error is explained below. [...] (1) here the message in the stdout when doing Ctrl+Click is: ### TCodeToolManager.HandleException: : erwartet aber 'java.lang' gefunden at Line=11763 Col=35 in /mnt/data/source/fpc/fpc-jvm/rtl/android/jvm/androidr14.pas (2) here the message in the stdout when doing Ctrl+Shift+Down is: ### TCodeToolManager.HandleException: ; erwartet aber const gefunden at Line=37 Col=5 in /home/sven/projects/android/trainlog/traindata.pas Fixed in trunk. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem with JVM and/or native types
On 28.12.2011 23:56, Mattias Gaertner wrote: On Sun, 25 Dec 2011 14:26:02 +0100 Sven Barthpascaldra...@googlemail.com wrote: Hello together! I'm currently experimenting with the JVM port and I have a problem when navigating a source file of mine (Lazarus revision 34392). The problematic locations are marked with // (number) of which the error is explained below. [...] (1) here the message in the stdout when doing Ctrl+Click is: ### TCodeToolManager.HandleException: : erwartet aber 'java.lang' gefunden at Line=11763 Col=35 in /mnt/data/source/fpc/fpc-jvm/rtl/android/jvm/androidr14.pas (2) here the message in the stdout when doing Ctrl+Shift+Down is: ### TCodeToolManager.HandleException: ; erwartet aber const gefunden at Line=37 Col=5 in /home/sven/projects/android/trainlog/traindata.pas Fixed in trunk. It works indeed better (number (2) is solved and some Ctrl+Click into import units work), but I'm still getting errors. 1.) I have seen that you check for the define JVM. Shouldn't this be CPUJVM instead? (just asking) 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] Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem with JVM and/or native types
On Thu, 29 Dec 2011 00:09:56 +0100 Sven Barth pascaldra...@googlemail.com wrote: On 28.12.2011 23:56, Mattias Gaertner wrote: On Sun, 25 Dec 2011 14:26:02 +0100 Sven Barthpascaldra...@googlemail.com wrote: Hello together! I'm currently experimenting with the JVM port and I have a problem when navigating a source file of mine (Lazarus revision 34392). The problematic locations are marked with // (number) of which the error is explained below. [...] (1) here the message in the stdout when doing Ctrl+Click is: ### TCodeToolManager.HandleException: : erwartet aber 'java.lang' gefunden at Line=11763 Col=35 in /mnt/data/source/fpc/fpc-jvm/rtl/android/jvm/androidr14.pas (2) here the message in the stdout when doing Ctrl+Shift+Down is: ### TCodeToolManager.HandleException: ; erwartet aber const gefunden at Line=37 Col=5 in /home/sven/projects/android/trainlog/traindata.pas Fixed in trunk. It works indeed better (number (2) is solved and some Ctrl+Click into import units work), but I'm still getting errors. 1.) I have seen that you check for the define JVM. Shouldn't this be CPUJVM instead? (just asking) I changed them to CPUJVM. 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. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Problem with JVM and/or native types
Hello together! I'm currently experimenting with the JVM port and I have a problem when navigating a source file of mine (Lazarus revision 34392). The problematic locations are marked with // (number) of which the error is explained below. === source begin === unit TrainData; {$namespace org.sven.trainlog} {$mode objfpc}{$H+} {$modeswitch unicodestrings} interface uses AndroidR14; type ETrainLogData = class(JLException) // (1) end; TTrainLogHelper = class(ADSSqliteOpenHelper) // (1) private const DatabaseVersion = 1; DatabaseName = 'trainlog'; CreateTableTrainFamily = 'create table TrainFamily (' + ' _id integer primary key autoincrement,' + ' name varchar not null' + ')'; CreateTableTrainType = 'create table TrainType (' + ' _id integer primary key autoincrement,' + ' name varchar not null,' + ' family_id integer not null' + ')'; CreateTableTrain = 'create table Train (' + ' _id integer primary key autoincrement,' + ' name varchar not null,' + ' cnt integer not null default 0,' + ' type_id integer not null' + ')'; public const ColumnTrainFamilyName = 'name'; ColumnTrainTypeName = 'name'; ColumnTrainName = 'name'; ColumnTrainCount = 'cnt'; TableTrainFamily = 'TrainFamily'; TableTrainType = 'TrainType'; TableTrain = 'Train'; public constructor Create(aContext: ACContext); // (2) procedure onCreate(aDatabase: ADSSqliteDatabase); override; procedure onUpgrade(aDatabase: ADSSqliteDatabase; aOldVersion, aNewVersion: jint); override; function GetAllTrainFamilies: ADCursor; function GetTrainTypesByFamily(aFamily: jlong): ADCursor; function GetTrainsByType(aType: jlong): ADCursor; procedure AddTrainFamily(aName: String); procedure AddTrainType(aName: String); procedure AddTrain(aName: String); function GetNameOfFamily(aID: jlong): String; procedure SetNameOfFamily(aID: jlong; aNewName: String); function GetNameOfType(aID: jlong): String; procedure SetNameOfType(aID: jlong; aNewName: String); function GetNameOfTrain(aID: jlong): String; procedure SetNameOfTrain(aID: jlong; aNewName: String); function GetCountOfTrain(aID: jlong): jint; procedure SetCountOfTrain(aID: jlong; aNewCount: jint); procedure DeleteTrainFamily(aID: jlong); procedure DeleteTrainType(aID: jlong); procedure DeleteTrain(aID: jlong); end; implementation ... end. === source end === (1) here the message in the stdout when doing Ctrl+Click is: ### TCodeToolManager.HandleException: : erwartet aber 'java.lang' gefunden at Line=11763 Col=35 in /mnt/data/source/fpc/fpc-jvm/rtl/android/jvm/androidr14.pas (2) here the message in the stdout when doing Ctrl+Shift+Down is: ### TCodeToolManager.HandleException: ; erwartet aber const gefunden at Line=37 Col=5 in /home/sven/projects/android/trainlog/traindata.pas Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem with JVM and/or native types
On 25.12.2011 14:26, Sven Barth wrote: Hello together! I'm currently experimenting with the JVM port and I have a problem when navigating a source file of mine (Lazarus revision 34392). The problematic locations are marked with // (number) of which the error is explained below. The subject should read Problem with JVM and/or nested types -.- Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus