Re: [Lazarus] Can Lazarus/FPC sign the created executables (Windows)?
On Tue, 24 Sep 2024 11:20:26 +0200, Martin Frb via lazarus wrote: >On 24/09/2024 09:09, Bo Berglund via lazarus wrote: >> I have run into a problem where certain customers require the applications >> to be >> "signed" and now I wonder if there is an option somewhere in Lazarus or FPC >> to >> do that when building an app? >> >> If so how does one go about it? >> >> Googling brings up stuff about Windows SDK etc, but I want to stay with FPC >> if >> possible >> >> Has someone here already done this and can share the way to do it? >" Project Options" => "Compiler Commands" > >You can use "Execute after" to invoke the "signtool.exe" (can be >downloaded from Microsoft). >Neither Lazarus, nor Fpc contain the functionality of the signtool (or >any similar software). > >The rest depends on the certificate that you use to sign with. (I.e. >where/how it is stored/accessed) OK, thanks. I downloaded the Windows SDK installer and when I ran it I got to a selection page where I could select to ONLY install the signing tool. The InnoSetup6 install builder does have support for signing so I will go there for further research. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Can Lazarus/FPC sign the created executables (Windows)?
I have run into a problem where certain customers require the applications to be "signed" and now I wonder if there is an option somewhere in Lazarus or FPC to do that when building an app? If so how does one go about it? Googling brings up stuff about Windows SDK etc, but I want to stay with FPC if possible Has someone here already done this and can share the way to do it? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Email sending program using Indy stopped working - seems to be an SSL problem
On Sat, 13 Jan 2024 00:54:59 +0100, Bo Berglund via lazarus wrote: >I wrote a commit reporting application for Windows Server16 back in 2018 using >then current Lazarus/Fpc. >It is a command line program called from a hook in subversion to distribute the >log message and details of commits among co-workers. > >It uses Indy 10.6.2 to do its job. >The mailer class has these in uses: > {Indy units:} > IdSMTP, > IdMessage, > IdEMailAddress, > IdIOHandler, > IdIOHandlerSocket, > IdIOHandlerStack, > IdSSL, > IdSSLOpenSSL, > IdExplicitTLSClientServerBase, > IdMessageBuilder, > >Back mid-december 2023 the emails stopped arriving but the problem was not >discovered/reported until I myself recently did a commit and I did not get the >expected log message email... > >Now I have looked in the logfiles the application creates and found this error >example: > >20240111 17:13:35.343 Connecting to mailserver >20240111 17:13:36.590 EXCEPTION: In SendSvnMessage = Error connecting with SSL. >error:1409442E:SSL routines:ssl3_read_bytes:tlsv1 alert protocol version > >My development system is a Windows 10 x64 PC... FINALLY: After I posted on the Atozed forum I received a reply where a by me previously unknown configuration item for TIdSSLIOHandlerSocketOpenSSL was suggested: constructor TSvnMessage.Create; begin FSvnUsers := TSvnUsers.Create; FSubscription := TStringList.Create; FSMTP := TIdSMTP.Create(nil); FSSLHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); //Add this to set the scope of SSL versions allowed: FSSLHandler.SSLOptions.SSLVersions := [sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2]; FMailMessage := TIdMessage.Create(nil); end; This single line in the code for my mailer made it resume operations toward the changed mail server! Posting here in case someone wonders in the future about how to fix it. Issue closed. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Email sending program using Indy stopped working - seems to be an SSL problem
On Sun, 14 Jan 2024 12:54:08 +0100 (CET), Michael Van Canneyt via lazarus wrote: >The synapse package is not installed in the IDE, it does not >install any components on the component palette. > >The Synapse package just offers classes which you must create in code. > >But once you compiled the package, you can specify it as a dependency. > >This is explained in my article, in the first paragraphs. > >> >> Inside the pdf I found a link to http://synapse.ararat.cz/ but there seems >> to be >> only files from more than 10 years ago, how could they solve the recently >> encountered ssl problem? > >The latest code is on sourceforge: > >https://sourceforge.net/p/synalist/code/HEAD/tree/trunk/ > >You can see it referenced on: > >http://synapse.ararat.cz/doku.php/download > >The maintainer is considering switching to git(lab|hub), but this will take >some time. > >However, the package in lazarus should be up-to-date for your needs, I think. > >> Could you (or someone else reading this) suggest a new SendSvnMessage >> function >> that will replace the following (snippets) but using Synapse (and say from >> where >> I can get synapse): > >The following program compiles: > >With the aid of my article, you should be able to extend the code to work with >attachments etc. Thank you so much for your help! I don't need attachmentshere since it is a commit reporting utility, just listing what was committed and the message entered. I have now retrieved the synapse package sources (using SVN from SourceForge) and compiled in Lazarus. So I am now making a test program to only prove that the mail server I must use will play balls and accept the postings. A few more questions: 1) Is there a way to set the mail property "Reply-to" when using synapse? There might be a case when the sender of an email (the From address) has to be the account owner and I want to make sure that those that receive the message can reply to it and get to the actual person making the SVN commit. It does not appear to be that way here: function SendToEx(const MailFrom, MailTo, Subject, SMTPHost: string; const MailData: TStrings; const Username, Password: string): Boolean; I assume MailData is the mail body... 2) How can I add Bcc recipients? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Email sending program using Indy stopped working - seems to be an SSL problem
On Sat, 13 Jan 2024 17:03:55 +0100 (CET), Michael Van Canneyt via lazarus wrote: >You could also use Synapse. I always prefer synapse over Indy. > So I have now verified that I cannot use Indy10 for email sending anymore :( ... I have used Indy since a very long time like 20 years or so when dealing with Internet accesses. So I am not used to other ways. Now I have looked around for valid examples which will work like my send function but using Synapse but the result is confusing. I have found your pdf document "Sending mails using Lazarus.pdf". But I am not clear as to how to map the Indy properties to Synapse... And the example's uses clause is not shown so I don't know what to put there... In fact I have looked for Synapse and in OnLine Package Manager I find Synapse_40.1, which I have installed via OLPM. But when looking through the packages in Lazarus I cannot find any match to synapse at all. What have I done wrong? Inside the pdf I found a link to http://synapse.ararat.cz/ but there seems to be only files from more than 10 years ago, how could they solve the recently encountered ssl problem? Could you (or someone else reading this) suggest a new SendSvnMessage function that will replace the following (snippets) but using Synapse (and say from where I can get synapse): uses ... IdSMTP, IdMessage, IdEMailAddress, IdIOHandler, IdIOHandlerStack, IdSSL, IdSSLOpenSSL, IdExplicitTLSClientServerBase, IdMessageBuilder, ... type { TSvnUser } //Data from SVN user config is put here TSvnUser = class public LoginName, FullName, Email: string; end; { TSvnMessage } TSvnMessage = class private FSMTP: TIdSMTP; FSSLHandler: TIdSSLIOHandlerSocketOpenSSL; FMailMessage: TIdMessage; FMailServer: string; FMailLogin: string; FMailPwd: string; FMailPort: word; FMailUseSSL: boolean; FMailTimeout: integer; FSvnUsers: TSvnUsers; //A list of users (TSvnUser) and data ... function TSvnMessage.SendSvnMessage: boolean; var sSubject: string; i: integer; begin Result := false; try PrepareMessage; //Set up the SMTP transfer properties FSMTP.Port := FMailPort; FSMTP.Host := FMailServer; FSMTP.AuthType := satDefault; FSMTP.Username := FMailLogin; FSMTP.Password := FMailPwd; FSMTP.MailAgent := 'SVNMailer'; if FMailUseSSL then begin FSMTP.IOHandler := FSSLHandler; FSMTP.UseTLS := utUseImplicitTLS; FSSLHandler.Port := FMailPort; end; FSMTP.ConnectTimeout := FMailTimeout; //Now send message Log('Connecting to mailserver'); FSMTP.Connect; if FSMTP.Connected then begin Log('Sending message'); FSMTP.Send(FMailMessage); Log('Send done'); FSMTP.Disconnect(); Result := true; end; except on E: Exception do begin LogException('In SendSvnMessage = ' + E.Message); end; end; end; procedure TSvnMessage.PrepareMessage; var i: integer; Usr, Msg: string; SU: TSvnUser; MA: TIdEMailAddressItem; //<== Does Synapse have something like this? begin (*if Pos('', FMailMessage.Body.Text) > 0 then FMailMessage.ContentType := 'text/html; charset=utf-8' else FMailMessage.ContentType := 'text/plain; charset=utf-8';*) Msg := 'Recipients:'; for i := 0 to FSubscription.Count - 1 do begin Usr := Lowercase(FSubscription[i]); if Pos('#', Usr) > 0 then Continue; SU := FSvnUsers.UserByLogin[Usr]; if SU <> NIL then begin MA := FMailMessage.Recipients.Add; // How is this done in Synapse? MA.Name := SU.FullName; // <== The name: 'John Doe' MA.Address := SU.Email; // <== The address: john@somedomain.com Msg := Msg + ' ' + Usr; end; end; Log(Msg); end; -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Email sending program using Indy stopped working - seems to be an SSL problem
On Sat, 13 Jan 2024 17:03:55 +0100 (CET), Michael Van Canneyt via lazarus wrote: >Or you use the system installed mailer. That's what I do. >I write the mail to file and invoke sendmail. > >No hassle with TLS, failed connections and whatnot. >sendmail will do what it takes, even retry in case of temporary failure. > >Michael. So you are implying there is a command line activated "mailer" on Windows Server 2016? Could you please expand a bit on that, it seems like a way to solve my problem if it is like so. I searched on the net and found this: https://tecadmin.net/send-email-from-windows-command-line/ However after I went through all of the steps outlined there on my actual Server 2016 powershell command line I received after some time (maybe a minute) the following: ... PS H:\> $SMTPClient.Send($Email) .. Exception calling "Send" with "1" argument(s): "The operation has timed out." At line:1 char:1 + $SMTPClient.Send($Email) + + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : SmtpException PS H:\> So how can I utilize this successfully from my FPC console program? If it works using "Powershell" how can I then execute the commands from my program using TProcess? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Email sending program using Indy stopped working - seems to be an SSL problem
On Sat, 13 Jan 2024 09:30:17 +0100 (CET), Michael Van Canneyt via lazarus wrote: > > >On Sat, 13 Jan 2024, Bo Berglund via lazarus wrote: > >> I wrote a commit reporting application for Windows Server16 back in 2018 >> using >> then current Lazarus/Fpc. >> It is a command line program called from a hook in subversion to distribute >> the >> log message and details of commits among co-workers. >> >> It uses Indy 10.6.2 to do its job. In fact I don't know which Indy10 version was current in 2018 but I recompiled today with Lazarus 2.2.4 + Fpc 3.2.2 and there was no improvement. :( >> Now I have looked in the logfiles the application creates and found this >> error >> example: >> >> 20240111 17:13:35.343 Connecting to mailserver >> 20240111 17:13:36.590 EXCEPTION: In SendSvnMessage = Error connecting with >> SSL. >> error:1409442E:SSL routines:ssl3_read_bytes:tlsv1 alert protocol version >> > >Indy 10 uses a completely outdated version of the SSL library, which does >not have the most recent cryptographic routines (notably for tls). > >Most likely the server was updated and now rejects this old version. It looks likely. I will check with the ISP tech support on Monday (this company closes support on week-ends).. >There is of course a new version of the openssl library (3.2.x). >The interface of that library changed, but to the best of my knowledge, >indy does not support it. Then I have to switch to my backup plan, which is to do the mailing itself from a php script on my webserver (hosted at the same ISP server as the mail server is running on). Then I have to modify the mailer program so it posts the data to that php handler instead of using the SMTP Indy component to do the job. >The sgcWebSockets suite has an updated version of openssl which should be able >to >support openssl 3, but that is paying software.. > There is a lot of stuff related to the SVN server communications built into my mailer also using Indy so I will have to modify that application... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Email sending program using Indy stopped working - seems to be an SSL problem
On Sat, 13 Jan 2024 09:31:19 +0100, Jean SUZINEAU via lazarus wrote: >I am not sure but it looks like your program is using TLS v1 protocol. >I think that TLS v1 is deprecated and now your SMTP mailserver requires >a newer version of TLS. >May be your SMTP mailserver / Windows Server 2016 has been updated >recently ? The mailserver is not mine, it is on my ISP where I have my webhosting. THe Windows 2016 Server is where I host the SubVersion server and where my reporting program runs... I too think that the ISP mailserver has been updated... I have tried to recompile the application originally created back in 2018 now using Lazarus 2.2.4 / Ppc 3.2.2 in the hope that Indy would have been updated. But no, it does not change - the problem is still there. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Email sending program using Indy stopped working - seems to be an SSL problem
I wrote a commit reporting application for Windows Server16 back in 2018 using then current Lazarus/Fpc. It is a command line program called from a hook in subversion to distribute the log message and details of commits among co-workers. It uses Indy 10.6.2 to do its job. The mailer class has these in uses: {Indy units:} IdSMTP, IdMessage, IdEMailAddress, IdIOHandler, IdIOHandlerSocket, IdIOHandlerStack, IdSSL, IdSSLOpenSSL, IdExplicitTLSClientServerBase, IdMessageBuilder, Back mid-december 2023 the emails stopped arriving but the problem was not discovered/reported until I myself recently did a commit and I did not get the expected log message email... Now I have looked in the logfiles the application creates and found this error example: 20240111 17:13:35.343 Connecting to mailserver 20240111 17:13:36.590 EXCEPTION: In SendSvnMessage = Error connecting with SSL. error:1409442E:SSL routines:ssl3_read_bytes:tlsv1 alert protocol version Can someone please advice: - Is there an external (dll?) file on Windows Server 2016 might need to be updated for ssl to work in email handling using Indy10 with SSL? - Where should I look for that file? - Or is there a different solution to the problem? My development system is a Windows 10 x64 PC... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Proper procedure after changing files for an installed package?
This is using Lazarus 3.0.0. I have a package with a GUI component which files I have downloaded on-line. The files are stored in a subdirectory to the pcp directory of Lazarus. The package has been "installed" in Lazarus earlier. Now I have retrieved updated files for this package and I wonder what is the proper procedure to get these installed in Lazarus? I can replace the 6-8 files with the new versions in the pcp dir the original files live in. But then what? Do I open Lazarus and use the function "Tools/Build Lazarus with Profile Normal IDE" or do I have to find the package below menu item "Packages" and explicitly command a Compile/Install? I believe that the file timestamps are not really reliable indicators of the new files... Somehow the package needs to be explicitly built. I have not encountered this situation earlier... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.2.6 on Raspberry Pi5B, error during build
On Mon, 11 Dec 2023 07:49:25 +0300, Mehmet Erol Sanliturk via lazarus wrote: >( 1 ) > >Please notice statement 3 : > >1 unit UITypes >2 {$IF FPC_FULLVERSION >= 30200} >3 deprecated 'Use System.UITypes instead (available since FPC 3.2.0)'; > >( 2 ) > >Present form of this unit is defective : > >2 {$IF FPC_FULLVERSION >= 30200} >... ( A ) >57 {$ELSE} >... ( B ) >90 {$ENDIF} > >( A ) and ( B ) parts are determining different values for > >mrNone..mrLast > >and they are used in the part > >91 >... >106 > >part . > > >91 ... 106 statements should be defined for each case > >in ( A ) and ( B ) parts separately when such a different limits occur . Yes, I did notice that. But the code is inside the official Lazarus sources for release 2.2.6 from gitlab, so I cannot do anything about it. Furthermore, if I change the fpc version used to build Lazarus from the 3.2.2 created by compiling the official sources of fpc to a 3.2.2 version retrieved via apt, then the error goes away without changing the Lazarus sources. It is still there in the file but with the apt retrieved compiler is does not trigger the error even though building from the same sources Sigh, I don't have the knowledge to dig deeper into this so I will keep using the fpc retrieved via apt instead of building from sources even though that pollutes my system with files outside of $HOME. And this problem only happens on the 64 bit arm system... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.2.6 on Raspberry Pi5B, error during build
On Sun, 10 Dec 2023 20:10:38 +0300, Mehmet Erol Sanliturk via lazarus wrote: >There is a statement > > 90 {$ENDIF} > >Its outside of {$IFDEF } is not listed . >It is very likely that > >mrNone..mrLast > >values are defined outside of ( IFDEF , ENDIF ) pairs . > Below is the full text of that file and the only define used is on line 2 where the fpc compiler is checked to be 3.2.0 or above in which case the reading of the file should be lines 3..56 and then continue on line 91. So since the compiler is fpc ver 3.2.2 this should NOT bring us down to line 58..89, but it seems like it jumps there anyway... Where is the identifier FPC_FULLVERSION defined?? Anyway, I gave up and disabled my own compiler and installed fpc 3.2.2 via apt and then the issue does not appear anymore. But now I have the fpc compiler *outside* of my $HOME file hierarchy... See also my notes at the bottom of the file (lines 89 and 105). File body:/home/bosse/devtools/lazarus/2.2.6/components/lazutils/uitypes.pas 1 unit UITypes 2 {$IF FPC_FULLVERSION >= 30200} 3 deprecated 'Use System.UITypes instead (available since FPC 3.2.0)'; 4 5 {$mode objfpc}{$H+} 6 7 interface 8 9 uses 10 System.UITypes; 11 12 const 13 mtWarning = System.UITypes.TMsgDlgType.mtWarning; 14 mtError= System.UITypes.TMsgDlgType.mtError; 15 mtInformation = System.UITypes.TMsgDlgType.mtInformation; 16 mtConfirmation = System.UITypes.TMsgDlgType.mtConfirmation; 17 mtCustom = System.UITypes.TMsgDlgType.mtCustom; 18 19 mbYes = System.UITypes.TMsgDlgBtn.mbYes; 20 mbNo = System.UITypes.TMsgDlgBtn.mbNo; 21 mbOK = System.UITypes.TMsgDlgBtn.mbOK; 22 mbCancel = System.UITypes.TMsgDlgBtn.mbCancel; 23 mbAbort= System.UITypes.TMsgDlgBtn.mbAbort; 24 mbRetry= System.UITypes.TMsgDlgBtn.mbRetry; 25 mbIgnore = System.UITypes.TMsgDlgBtn.mbIgnore; 26 mbAll = System.UITypes.TMsgDlgBtn.mbAll; 27 mbNoToAll = System.UITypes.TMsgDlgBtn.mbNoToAll; 28 mbYesToAll = System.UITypes.TMsgDlgBtn.mbYesToAll; 29 mbHelp = System.UITypes.TMsgDlgBtn.mbHelp; 30 mbClose= System.UITypes.TMsgDlgBtn.mbClose; 31 32 type 33 // Message dialog related 34 TMsgDlgType= System.UITypes.TMsgDlgType; 35 TMsgDlgBtn = System.UITypes.TMsgDlgBtn; 36 TMsgDlgButtons = set of System.UITypes.TMsgDlgBtn; 37 38 // ModalResult 39 TModalResult = System.UITypes.TModalResult; 40 PModalResult = System.UITypes.PModalResult; 41 42 const 43 // Used for ModalResult 44 mrNone = System.UITypes.mrNone; 45 mrOK = System.UITypes.mrOK; 46 mrCancel = System.UITypes.mrCancel; 47 mrAbort = System.UITypes.mrAbort; 48 mrRetry = System.UITypes.mrRetry; 49 mrIgnore = System.UITypes.mrIgnore; 50 mrYes = System.UITypes.mrYes; 51 mrNo = System.UITypes.mrNo; 52 mrAll = System.UITypes.mrAll; 53 mrNoToAll = System.UITypes.mrNoToAll; 54 mrYesToAll = System.UITypes.mrYesToAll; 55 mrClose = System.UITypes.mrClose; 56 mrLast = System.UITypes.mrLast; 57 {$ELSE} 58 ; 59 60 {$mode objfpc}{$H+} 61 62 interface 63 64 type 65 // Message dialog related 66 TMsgDlgType= (mtWarning, mtError, mtInformation, mtConfirmation, mtCustom); 67 TMsgDlgBtn = (mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, 68 mbAll, mbNoToAll, mbYesToAll, mbHelp, mbClose); 69 TMsgDlgButtons = set of TMsgDlgBtn; 70 71 // ModalResult 72 TModalResult = low(Integer)..high(Integer); 73 PModalResult = ^TModalResult; 74 75 const 76 // Used for ModalResult 77 mrNone = 0; 78 mrOK = mrNone + 1; 79 mrCancel = mrNone + 2; 80 mrAbort = mrNone + 3; 81 mrRetry = mrNone + 4; 82 mrIgnore = mrNone + 5; 83 mrYes = mrNone + 6; 84 mrNo = mrNone + 7; 85 mrAll = mrNone + 8; 86 mrNoToAll = mrNone + 9; 87 mrYesToAll = mrNone + 10; 88 mrClose = mrNone + 11; 89 mrLast = mrClose; //Should this be: mrLast = mrNone + 12 maybe??? 90 {$ENDIF} 91 92 // String representation of ModalResult values 93 ModalResultStr: array[mrNone..mrLast] of shortstring = ( 94 'mrNone', 95 'mrOk', 96 'mrCancel', 97 'mrAbort', 98 'mrRetry', 99 'mrIgnore', 100 'mrYes', 101 'mrNo', 102 'mrAll', 103 'mrNoToAll', 104 'mrYesToAll', 105 'mrClose'); //Should there be another line for mrLast maybe??? 106 107 108 implementation 109 110 end. -- -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.2.6 on Raspberry Pi5B, error during build
On Sun, 10 Dec 2023 20:01:15 +0300, Maxim Ganetsky via lazarus wrote: >> So I am using the self-compiled fpc 3.2.3 to build Lazarus 2.2.6 and it fails >> during build with the following exit message (only end of output shown): >This combination of FPC and Lazarus won't work. You should use head >revisions of Lazarus from `fixes_3_0` or `main` branches if you want >use FPC 3.2.3 and up. Well, the failed test *was* with FPC compiled from sources with last change date on github a week ago, i.e. head I believe... I have not been able to build anything else on this 64 bit machine. But I gave up and used apt to install fpc 3.2.2: sudo apt install fpc After removing the symlinks to the self-compiled fpc version I could use the apt retrieved compiler and then Lazarus built to the end and is now running fine. But going forward I don't know how to handle future upgrades to the compiler. Will Lazarus complain if I get the next version of fpc to my system via a normal update/upgrade cycle? Since it is done by apt it may well change in the future without me noting. Or do I have to reconfigure something at that time? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Lazarus 2.2.6 on Raspberry Pi5B, error during build
I am setting up my new RPi3B with 64 bit Pi-OS Bookworm and have now come to FreePascal/Lazarus. Freepascal is built from sources (trunk of 3.2.3) using a seed compiler 3.2.2 earlier obtained as an apt install on an RPi4B also running Pi-OS 64 bit Bookworm. On this new system I want to build from sources to get everything inside my $HOME environment. That is why I did not install fpc 3.2.2 via apt. Fpc built just fine with these sources so that is how I got 3.2.3. Note that I am using fpc 3.2.3 head revision on this system since no other version seems to be possible to build on the 64 bit Pi-OS. But that version builds without problems. So I am using the self-compiled fpc 3.2.3 to build Lazarus 2.2.6 and it fails during build with the following exit message (only end of output shown): make bigide (9009) Assembling translations (3104) Compiling uitypes.pas /home/bosse/devtools/lazarus/2.2.6/components/lazutils/uitypes.pas(105,14) Error: (3285) Expected another 2 array elements /home/bosse/devtools/lazarus/2.2.6/components/lazutils/uitypes.pas(93,58) Fatal: (10026) There were 1 errors compiling module, stopping Fatal: (1018) Compilation aborted make[1]: *** [Makefile:3394: lazutils.ppu] Error 1 make[1]: Leaving directory '/home/bosse/devtools/lazarus/2.2.6/components/lazutils' make: *** [Makefile:3802: lazutils] Error 2 This is how the file looks like at the location indicated: 62 interface 63 64 type 65 // Message dialog related 66 TMsgDlgType= (mtWarning, mtError, mtInformation, mtConfirmation, mtCustom); 67 TMsgDlgBtn = (mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, 68 mbAll, mbNoToAll, mbYesToAll, mbHelp, mbClose); 69 TMsgDlgButtons = set of TMsgDlgBtn; 70 71 // ModalResult 72 TModalResult = low(Integer)..high(Integer); 73 PModalResult = ^TModalResult; 74 75 const 76 // Used for ModalResult 77 mrNone = 0; 78 mrOK = mrNone + 1; 79 mrCancel = mrNone + 2; 80 mrAbort = mrNone + 3; 81 mrRetry = mrNone + 4; 82 mrIgnore = mrNone + 5; 83 mrYes = mrNone + 6; 84 mrNo = mrNone + 7; 85 mrAll = mrNone + 8; 86 mrNoToAll = mrNone + 9; 87 mrYesToAll = mrNone + 10; 88 mrClose = mrNone + 11; 89 mrLast = mrClose; 90 {$ENDIF} 91 92 // String representation of ModalResult values 93 ModalResultStr: array[mrNone..mrLast] of shortstring = ( 94 'mrNone', 95 'mrOk', 96 'mrCancel', 97 'mrAbort', 98 'mrRetry', 99 'mrIgnore', 100 'mrYes', 101 'mrNo', 102 'mrAll', 103 'mrNoToAll', 104 'mrYesToAll', 105 'mrClose'); 106 107 To me it seems like the number of elements is not in error... What can cause this failure and how can I solve it? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Mysterious crash with Lazarus on RPi4B running PiOS bookworm 32 bit
On Fri, 8 Dec 2023 09:18:17 +0100, Jean SUZINEAU via lazarus wrote: >May be you'll find some information in the log, something like : > >cat /var/log/xrdp.log > This is how the 13 minute session end was logged: [20231207-21:44:04] [INFO ] sesman connect ok [20231207-21:44:04] [INFO ] sending login info to session manager. Please wait... [20231207-21:44:04] [INFO ] xrdp_wm_log_msg: login successful for user bosse on display 10 [20231207-21:44:04] [INFO ] login successful for user bosse on display 10 [20231207-21:44:04] [INFO ] loaded module 'libxup.so' ok, interface size 9456, version 4 [20231207-21:44:04] [INFO ] started connecting [20231207-21:44:04] [INFO ] lib_mod_connect: connecting via UNIX socket [20231207-21:44:04] [INFO ] lib_mod_log_peer: xrdp_pid=4860 connected to X11rdp_pid=4863 X11rdp_uid=1000 X11rdp_gid=1000 client_ip=:::192.168.119.136 client_port=64630 [20231207-21:44:04] [INFO ] connected ok [20231207-21:57:36] [ERROR] xrdp_sec_recv: xrdp_mcs_recv failed [20231207-21:57:36] [ERROR] xrdp_rdp_recv: xrdp_sec_recv failed [20231207-21:57:36] [ERROR] libxrdp_process_data: xrdp_rdp_recv failed [20231207-21:57:36] [ERROR] xrdp_process_data_in: xrdp_process_loop failed [20231207-21:57:36] [ERROR] xrdp_iso_send: trans_write_copy_s failed [20231207-21:57:36] [ERROR] Sending [ITU T.125] DisconnectProviderUltimatum failed That is the end of the log... At 20231207-21:57:36 was when I clicked the "forbidden" item in Lazarus' color config dialog. It always happens, perfectly reproducible... And it screws the desktop, on next start of Lazarus only the main code editor and the top Lazarus bar are shown... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Mysterious crash with Lazarus on RPi4B running PiOS bookworm 32 bit
On Thu, 07 Dec 2023 18:34:57 +0100, Bo Berglund via lazarus wrote: >I will make a new attempt by starting over from scratch on a new system disk >and >just install fpc/lazarus and of course xrdp so I can use the desktop on the >headless system. But it will take some time to reach the same point... >3rd or 4th time I do this... > OK so now I am done with the latest attempt... I scrapped the SD-card for the last attempt and started over fresh. The only things I did before the fpc/lazarus test was the following: - Configured the new SDcard using Pi-Imager for bookworm 32 bit. - Started the system anew and connected by SSH - sudo apt update && sudo apt full-upgrade - Used apt to install the following standard packages: sudo apt install xrdp screen shellcheck openvpn fonts-hack-ttf subversion - Then: sudo apt install fpc lazarus Now I could connect to the GUI screen using the RDP client on Windows10. And I could start Lazarus from the main menu/Programming and it started up as I am used to. Then I went straight to Tools/Options/Environment/Editor/Display/Colors On that dialog I clicked the "Comment" line in the list of items to set the color for. And instantly the remote desktop session disappeared! So no matter if one uses VNC or RDP to get a GUI remote screen the exact same action kills the user session instantly without leaving any trace in the logs that I have been able to find. And this time I have installed Fpc/Lazarus using apt so an error in my own handling of source installs is not in play here. It must be something Lazarus does that is forbidden on 32 bit Pi-OS Bookworm... But what is it? Doing the same on 64 bit Pi-OS Bookworm works exactly as expected, i.e. no surprises... Colors can be set and all is fine and dandy. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Mysterious crash with Lazarus on RPi4B running PiOS bookworm 32 bit
On Mon, 04 Dec 2023 19:18:28 +0100, Bo Berglund via lazarus wrote: >Has anyone here managed to get Lazarus 2.2.6 running on a headless Raspberry >Pi4B with 32 bit PiOS bookworm and using VNC to access it? So the mystery remains even after I have done this on my RPi4B: - Stopped and disabled the existing RealVNC server as well as setting it to not start in raspi-config - Installed xrdp as a new remote desktop server not using VNC - Erased all remnants of previous installs of fpc/lazarus from source including the desktop menu entry in ~/.local/share/applications - Installed via apt: sudo apt install fpc lazarus (got 3.2.2 and 2.2.6) Now the new Lazarus appears in my main menu below Programming. When I start Lazarus from the menu shortcut it starts up seemingly normally. So now I headed to Tools/Options/Editor/Display/Colors Waited a while for a crash but nothing happened. After half a minute I clicked on the item "abc Comment" in order to change to my usual color (green). And at that very moment the remote connection crashed, the whole window disappeared with all its content! When I reconnect RDP all looks normal except when I start Lazarus agin the window arrangement has been screwed up, all windows are not there anymore. But the exact same behaviour happens. What in the world could trigger a total and sudden crash of the whole remote session now with a completely different handler (xrdp vs VNC)??? What is the thing done in Lazarus when one clicks the "abc Comment" item in the selector list that is so major? I will make a new attempt by starting over from scratch on a new system disk and just install fpc/lazarus and of course xrdp so I can use the desktop on the headless system. But it will take some time to reach the same point... 3rd or 4th time I do this... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Can I rebuild Lazarus installed via apt on an RPi4B?
On Thu, 7 Dec 2023 00:34:01 +0100, Mattias Gaertner via lazarus wrote: > > >On 07.12.23 00:05, Bo Berglund via lazarus wrote: >> Since every customization of Lazarus means the IDE must be rebuilt it also >> means >> that Lazarus must be installed where the current user has permissions to do >> that. >> >> But when installing stuff via sudo apt install package it normally gets into >> read-only locations, right? > >Yes, this is a multi user installation. My post was done at midnight so I could not test further. But today I checked on a 32 bit bookworm RPi4B to install lazarus via apt (not sudo apt) and I found that it complains about not being root, so that route seems to be closed. Also looked at the /usr/bin dir and it is owned by root so no chance of installing as a user there... I thought that perhaps when running apt without sudo it would change install path to something inside the $HOME location, but apparently not... > >> So how does this work? > >Lazarus tests before compiling a package if the output directory is >writable and if not redirects to a sub directory of its config directory. >This is a feature of the IDE and lazbuild. >The makefiles do not support this, so a "make" fails. So to rebuild Lazarus from the command line I should use lazbuild, right? What arguments are needed for lazbuild? I looked here: https://wiki.lazarus.freepascal.org/lazbuild So will this be sufficient: lazbuild --build-ide="Normal IDE" --pcp="$HOME/.lazarus_2.2.6" --compiler=$HOME/bin/ppcarm ... If I use sudo apt install lazarus, will that also pull fpc as a dependency or should I use: sudo apt install fpc lazarus instead? And what about the lazarus sources, are they pulled in as well with the sudo apt install lazarus command? >If you want to compile lazarus with make, use a git clone of the lazarus >repository. > I have been building Fpc/Lazarus from sources since many years, also tested fpcupdeluxe a few times. So getting/using the sources is known. I usually download the tarballs with a release tag from gitlab using wget. After I have built fpc and symlinked into $HOME/bin I build Lazarus like this: cd $HOME/devtools/lazarus/2.2.6/ make clean PP=$HOME/bin/ppcarm && make bigide PP=$HOME/bin/ppcarm I create a separate $HOME/.lazarus_2.2.x config dir and specify that in the desktop file as the --pcp= argument. Now when I am checking the various new versions of Raspberry Pi and the Pi-OS (bullseye-bookworm, 32-64 bit, RPi4B-RPi5B etc) it leads to many iterations in the fpc/lazarus installs... I have been looking for a simpler way still allowing for having several versions of Lazarus/fpc and it led me to look at fpcupdeluxe. But that tool was probably not ready for the new stuff on RPi so it failed to work properly. New fpc? Being able to upgrade fpc on the side without disruption of Lazarus is also an issue for me, is there some setting/config within the pcp directory that I can change to point Lazarus to a new fpc compiler and it will then be possible to rebuild Lazarus with that new compiler? And what about day-to-day project compiles if I want to use the new compiler? Is it as simple as changing the symlink of $HOME/bin/ppcarm to point to the new compiler? It would affect all user installs utilizing the ppcarm compiler. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Can I rebuild Lazarus installed via apt on an RPi4B?
Since every customization of Lazarus means the IDE must be rebuilt it also means that Lazarus must be installed where the current user has permissions to do that. But when installing stuff via sudo apt install package it normally gets into read-only locations, right? So how does this work? I have trouble installing from sources on a PiOS bookworm 32 bit system, so I figured I could get it via apt. But that is only an option if I can somehow add the packages I need into Lazarus... I get this on a 32 bit system: $ apt policy lazarus lazarus: Installed: (none) Candidate: 2.2.6+dfsg2-2 Version table: 2.2.6+dfsg2-2 500 500 http://raspbian.raspberrypi.com/raspbian bookworm/main armhf Packages And on a 64 bit system like this: $ apt policy lazarus lazarus: Installed: (none) Candidate: 2.2.6+dfsg2-2 Version table: 2.2.6+dfsg2-2 500 500 http://deb.debian.org/debian bookworm/main arm64 Packages 500 http://deb.debian.org/debian bookworm/main armhf Packages -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Mysterious crash with Lazarus on RPi4B running PiOS bookworm 32 bit
On Mon, 04 Dec 2023 15:58:59 +0100, Bo Berglund via lazarus wrote: >I have built a new system where I have installed fpc 3.2.2 and Lazarus 2.2.4 >from sources like I normally do. > >In this case I have encountered a very strange issue never seen before but >repeatable using both 2.2.4 and 2.2.6. > >All seems OK until I use the Tools/Options/Editor/Display/Color window to set >the color coding of various items like I usually have them. > >As soon as I select "Comment" in the list in order to change the color from >blue >to green it takes about 2-3 seconds and the whole user session crashes! In fact this is not even needed. Just wait a few seconds after reaching the dialog and it crashes! >Note that my SSH session is still working fine but the VNC totally vanishes. > >I have to reconnect (re-login) the VNC session and when I open Lazarus now the >window arrangement has been screwed up too... > >Tests: >I have tried both VNC server version 6 and version 7 on this RPi4B 32 bit >device. WRONG, bad memory... In fact VNC cannot be reached when using the version 7 shipped with PiOS, one has to revert to the previous version 6 to get a connection at all... So this is tested only with the VNC server version 6, shipped with the previous PiOS version (bullseye). > >And I have also tried Lazarus version 2.2.4 and 2.2.6 with the same exact >result. > >I have never seen Lazarus crash this way before and bringing the whole user >session down with it... > >What can be going on here? >Maybe I should re-install the whole system from scratch? > >It is probably faster than doing this troubleshooting Not really It took a few hours to erase the drive and restart from scratch to get to the same place And only to discover that the crash is still there as soon as one gets to the Tools/Options/Editor/Display/Colo dialog to customize text color. A few seconds after reaching this dialog the VNC session just dies! The RPi4B itself continues running so the SSH session is intact, onbly the VNC session is killed. And it happens when that spoecific Lazarus options dialog is activated. Other settings dialogs so far have behaved sensibly. Note that this time I have not even installed any extra packahes from OLPM or my own components. Plain Lazarus from sources. I can get it going on the RPi4B with 64 bit PiOS bookworm, just not with 32 bit But I need 32 bit in order to build for the 32 bit family of RPi devices. Has anyone here managed to get Lazarus 2.2.6 running on a headless Raspberry Pi4B with 32 bit PiOS bookworm and using VNC to access it? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Mysterious crash with Lazarus on RPi4B running PiOS bookworm 32 bit
I have built a new system where I have installed fpc 3.2.2 and Lazarus 2.2.4 from sources like I normally do. In this case I have encountered a very strange issue never seen before but repeatable using both 2.2.4 and 2.2.6. All seems OK until I use the Tools/Options/Editor/Display/Color window to set the color coding of various items like I usually have them. As soon as I select "Comment" in the list in order to change the color from blue to green it takes about 2-3 seconds and the whole user session crashes! Note that my SSH session is still working fine but the VNC totally vanishes. I have to reconnect (re-login) the VNC session and when I open Lazarus now the window arrangement has been screwed up too... Tests: I have tried both VNC server version 6 and version 7 on this RPi4B 32 bit device. Same issue. And I have also tried Lazarus version 2.2.4 and 2.2.6 with the same exact result. I have never seen Lazarus crash this way before and bringing the whole user session down with it... What can be going on here? Maybe I should re-install the whole system from scratch? It is probably faster than doing this troubleshooting -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus make clean fails...
On Mon, 4 Dec 2023 11:40:02 +0100 (CET), Michael Van Canneyt via lazarus wrote: >If you have multiple compilers on your system, you may be using a different >compiler compared to when you do not specify this parameter. I have several fpc:s too... >I always specify the starting compiler (because I have many versions >installed) so for me it is a way to make sure I am using the intended >compiler. Is that switch also available for startlazarus? So it can be specified inside the desktop file for the GUI menu? Like this: Exec=/home/bosse/devtools/lazarus/2.2.4/startlazarus PP=$HOME/bin/ppcarm --pcp=/home/bosse/.lazarus_2.2.4 %f -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus make clean fails...
On Sun, 3 Dec 2023 21:45:57 +0100 (CET), Michael Van Canneyt via lazarus wrote: >> Now I still get the same error when I try to do the make clean operation. >> >> ~/devtools/lazarus/2.2.6 $ make clean >> make: -iVSPTPSOTO: No such file or directory >> Makefile:234: *** The Makefile doesn't support target -, please run fpcmake >> first. Stop. >> >> Check compiler: >> ~/devtools/lazarus/2.2.6 $ fpc >> Free Pascal Compiler version 3.2.2 [2023/11/29] for arm >> Copyright (c) 1993-2021 by Florian Klaempfl and others >> >> ~/devtools/lazarus/2.2.6 $ ppcarm >> Free Pascal Compiler version 3.2.2 [2023/11/29] for arm >> Copyright (c) 1993-2021 by Florian Klaempfl and others >> >> So there is an fpc/ppcarm compiler available on path and it starts OK without >> arguments so the version can be checked. >> >> Still with this fresh source tree and a working fpc compiler it throws this >> strange error... > >The error means it cannot find the compiler. > >> >> Why and how to fix? > >Try this: > >make clean PP=ppcarm > >(preferably use the full path to the ppcarm compiler) > >If you then still get the error, it means the makefiles for Lazarus indeed >do not support your target, but how to fix that is up to the lazarus team to >answer. > >Michael. Thanks! Indeed, it seems like the make tool does not honor the PATH setting $ echo $PATH /home/bosse/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin: $ which ppcarm /home/bosse/bin/ppcarm But I do not get the errors when make is started like this: $ make clean PP=$HOME/bin/ppcarm So now I went back to my lazarus 2.2.6 source dir where I have installed all of my customizations and ran the make clean and make bigide with a specification of the compiler location as above, and it seems to have worked this time around. But when I start Lazarus it has lost the package customizations I made earlier, so I had to go over these again and rebuild the GUI afterwards from within Lazarus itself. OLPM + my own custom components But after that was done it seems like Lazarus is OK. What are the ramifications of adding the PP= directive to the make commands? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus make clean fails...
On Sat, 02 Dec 2023 19:03:41 +0100, Bo Berglund via lazarus wrote: >And concerning the compiler: > >$ which fpc >/home/bosse/bin/fpc > >$ which ppcarm >/home/bosse/bin/ppcarm > >$ fpc >Free Pascal Compiler version 3.2.2 [2023/11/29] for arm > >$ ppcarm >Free Pascal Compiler version 3.2.2 [2023/11/29] for arm > >What can I do now? > So I have now retired the Lazarus old source dir (rename to 2.2.6.bak). Then I expanded the source tgz file yet again to get the *clean* Lazarus release 2.2.6 sources from GitLab into my system. It was expanded into a directory named 2.2.6. Now I still get the same error when I try to do the make clean operation. ~/devtools/lazarus/2.2.6 $ make clean make: -iVSPTPSOTO: No such file or directory Makefile:234: *** The Makefile doesn't support target -, please run fpcmake first. Stop. Check compiler: ~/devtools/lazarus/2.2.6 $ fpc Free Pascal Compiler version 3.2.2 [2023/11/29] for arm Copyright (c) 1993-2021 by Florian Klaempfl and others ~/devtools/lazarus/2.2.6 $ ppcarm Free Pascal Compiler version 3.2.2 [2023/11/29] for arm Copyright (c) 1993-2021 by Florian Klaempfl and others So there is an fpc/ppcarm compiler available on path and it starts OK without arguments so the version can be checked. Still with this fresh source tree and a working fpc compiler it throws this strange error... Why and how to fix? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Lazarus make clean fails...
I have installed Lazarus 2.2.6 from sources on my RPi4B using fpc 3.2.0. This works fine. Then I compiled fpc 3.2.2 to get to a later version and did a make install/make sourceinstall on that version of fpc. Then I wanted to rebuild Lazarus with the new fpc so I first tried with a Lazarus rebuild from within Lazarus but that failed so I decied to do a clean build instead. Enter command line and: ~/devtools/lazarus/2.2.6 $ make clean make: -iVSPTPSOTO: No such file or directory Makefile:234: *** The Makefile doesn't support target -, please run fpcmake first. Stop. Google does not know about VSPTPSOTO... So I did as suggested: ~/devtools/lazarus/2.2.6 $ fpcmake Processing Makefile.fpc Error: Target "linux", package "rtl" not found Then I expanded the lazarus sources into a clean directory and tried make clean in that but with the same result. And concerning the compiler: $ which fpc /home/bosse/bin/fpc $ which ppcarm /home/bosse/bin/ppcarm $ fpc Free Pascal Compiler version 3.2.2 [2023/11/29] for arm $ ppcarm Free Pascal Compiler version 3.2.2 [2023/11/29] for arm What can I do now? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] PasLibVLC based video player does not run on Linux...
On Tue, 21 Nov 2023 19:29:58 +0100, Bo Berglund via lazarus wrote: >- Set video speed --- >To set the speed this is what I use in my code: > >procedure TfrmMain.btnFFClick(Sender: TObject); >begin > vlcPlayer.SetPlayRate(speSpeed.Value); >end; > >It goes here: > >procedure TPasLibVlcPlayer.SetPlayRate(rate: Integer); >begin > if (p_mi = NIL) then exit; > if (rate < 1) then exit; > if (rate > 1000) then exit; > libvlc_media_player_set_rate(p_mi, rate / 100); >end; > >And it winds up here: > >(** > * Set movie play rate > * > * param p_mi the Media Player > * param rate movie play rate to set > * return -1 if an error was detected, 0 otherwise (but even then, it might > * not actually work depending on the underlying media protocol) > *) > >var > libvlc_media_player_set_rate : function( >p_mi : libvlc_media_player_t_ptr; >rate : Single // float > ) : Integer; cdecl; Now I have searched in the test application tha uses the Lazarus lclvlc package and found this hidden inside the vlc.pp unit procedure TCustomVLCMediaPlayer.SetPlayRate(Avalue : Integer); begin if Assigned(FInstance) then begin if (Avalue< 1) then AValue:=1 else if (AValue>1000) then AValue:=1000; libvlc_media_player_set_rate(FInstance,AValue/100); end; end; So there is such a function inside but how can I use it in my top level code? I tried like this: procedure TfrmMainVlc.btnSpeedClick(Sender: TObject); var VideoSpeed: integer; begin VideoSpeed := speVideoSpeed.Value; Fplayer.SetPlayRate(VideoSpeed); end; But it generates an error: "identifier idents no member "SetPlayRate" So I tried to trace it further and found it in unit vlc: TCustomVLCMediaPlayer = Class(TComponent) private ... procedure SetPlayRate(AValue: Integer); ... So how can I get to use this function? I.e. how to publish it (it is private now)? If I trace it down to implementation it looks like this: procedure TCustomVLCMediaPlayer.SetPlayRate(Avalue : Integer); begin if Assigned(FInstance) then begin if (Avalue< 1) then AValue:=1 else if (AValue>1000) then AValue:=1000; libvlc_media_player_set_rate(FInstance,AValue/100); end; end; So all is there but not accessible for me... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] PasLibVLC based video player does not run on Linux...
On Tue, 21 Nov 2023 18:05:22 +0100 (CET), Michael Van Canneyt via lazarus wrote: > > >On Tue, 21 Nov 2023, Bo Berglund via lazarus wrote: > >Where did you find paslibvlc ? I found it here years ago: https://prog.olsztyn.pl/paslibvlc/ And the first commit to my video tool in svn using it was done in May 2019... > >The one I maintain is part of FPC and is in fpc/packages/libvlc. Yes and a few days ago I found it to be a part of fpc/lazarus and that made me try to see if I could find all the stuff I have used in paslibvlc also here so I could just exchange the player and modify the calls. Makes much more sense to use a package that is in effect maintained than one that is stale on the net. >> >> I have tried replacing PasLibVlc with LclVlc shipped with Lazarus but I am >> missing a couple of items that I use during playback (varying play speed and >> audio shift for lipsync), which PasLibVlc does expose. > >It should not be difficult to add those properties to lclvlc If one knows how it is done internally I guess it is doable but for me not... But I can trace what I use backwards into PasLibVlc and see where it finally ends up. So: - Delay audio I call the audio delay like this: procedure TfrmMain.btnShiftAudioClick(Sender: TObject); //For testing purposes, delay audio by value from speAudio var SyncCmd: string; begin vlcPlayer.SetAudioDelay(speAudio.Value * 1000); end; which calls this inside PasLibVlc: procedure TPasLibVlcPlayer.SetAudioDelay(delay: Int64); begin if not Assigned(p_mi) then exit; libvlc_audio_set_delay(p_mi, delay); end; and this is where it ends up: (** * Set current audio delay. The audio delay will be reset to zero each time the media changes. * * param p_mi media player * param i_delay the audio delay (microseconds) * return 0 on success, -1 on error * version LibVLC 1.1.1 or later *) var libvlc_audio_set_delay : function( p_mi: libvlc_media_player_t_ptr; i_delay : Int64 ) : Integer; cdecl; - Set video speed --- To set the speed this is what I use in my code: procedure TfrmMain.btnFFClick(Sender: TObject); begin vlcPlayer.SetPlayRate(speSpeed.Value); end; It goes here: procedure TPasLibVlcPlayer.SetPlayRate(rate: Integer); begin if (p_mi = NIL) then exit; if (rate < 1) then exit; if (rate > 1000) then exit; libvlc_media_player_set_rate(p_mi, rate / 100); end; And it winds up here: (** * Set movie play rate * * param p_mi the Media Player * param rate movie play rate to set * return -1 if an error was detected, 0 otherwise (but even then, it might * not actually work depending on the underlying media protocol) *) var libvlc_media_player_set_rate : function( p_mi : libvlc_media_player_t_ptr; rate : Single // float ) : Integer; cdecl; >> >> What are the requirements for the executable's environment for it to find the >> libvlc files? > >Notmally nothing. > >> >> And is it necessary for them to be there for the building process only or for >> the end user's execution too? > >libvlc is loaded dynamically, you can specify the name. Well, for lclvlc there are no problems because it finds the lib on the platforms I have tested it. Both RPi4 versions (32 and 64 bit) and Windows10. > >Michael. Thanks again! Nice to communicate with someone "in the know" for once! -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] PasLibVLC based video player does not run on Linux...
On Tue, 21 Nov 2023 16:23:37 +0100 (CET), Michael Van Canneyt via lazarus wrote: > > >On Tue, 21 Nov 2023, Bo Berglund via lazarus wrote: > >> As I have written in other posts I am trying to port a video application from >> Windows to Linux, specifically on Raspberry Pi4B with either bullseye or >> bookworm operating systems. >> >> The application runs very well on Windows and is based on PasLibVLC found >> here: >> https://prog.olsztyn.pl/paslibvlc/ >> >> But I am not able to make it show videos on Linux.. >> >> So as a test I have now reverted to a demo application on this website in >> order >> to minimize the possible problems: >> http://lazplanet.blogspot.com/2018/01/how-to-make-simple-video-player-in.html >> >> When I follow these instructions to create a test application on the RPi4B it >> builds but when executed the video window does not appear and no video can be >> played. Instead of a black player waiting for rthe file to play, there is a >> gray >> background just like the player was not created at all. >> >> If I copy the sources from RPi4B to my Windows10 PC and open the project in >> Lazarus there (same version 2.2.6) it builds fine, and in this case it also >> displays the video as expected. No problems there at all. Same sources. >> >> So something is not working in the Linux environment and I don't understand >> what. And whatever it is it does not generate any errors during >> compile/build on >> Linux. Thanks for responding! Much appreciated. >I developed it on linux, so at least then it worked. Do you mean lclVlc or PasLibVlc? I saw your name concerning the lclVlc package and the pdf documentation but another name (Robert Jedrzejczyk) is mentioned in the sources for PasLibVlc... I have tried replacing PasLibVlc with LclVlc shipped with Lazarus but I am missing a couple of items that I use during playback (varying play speed and audio shift for lipsync), which PasLibVlc does expose. And there is a curious animation of my progressbar when the video is jumped to a new position so the playing moves instantly but the progressbar is slowly reaching the actual position in about a second or so. This is mostly an appearance problem when I jump with the location buttons I have in my main application, but still looks strange. This is done now in a small test application where I am testing all the VLC calls used in the actual application I am porting but using LclVLC instead of PasLibVlc. When done there I will do the surgery on the main application itself. > >> >> I *have* enabled the threading system in the project file by putting cthreads >> into the uses clause as first item so it is not a thread initializatiuon >> problem: >> >> {$IFDEF UNIX} >> cthreads, >> {$ENDIF} >> >> >> Now I am wondering if it perhaps cannot find the VLC *libraries* that are >> supposed to be available on a system with VLC installed. But I do not know >> how >> thatr is supposed to work and I don't understand the code either. > On the newest RPi4 running bookworm 64 bit: $ apt policy libvlc-dev libvlc-dev: Installed: 1:3.0.20-0+rpt1+deb12u1 Candidate: 1:3.0.20-0+rpt1+deb12u1 Version table: *** 1:3.0.20-0+rpt1+deb12u1 500 500 http://archive.raspberrypi.com/debian bookworm/main arm64 Packages 100 /var/lib/dpkg/status 3.0.20-0+deb12u1 500 500 http://deb.debian.org/debian-security bookworm-security/main arm64 Packages 3.0.18-2 500 500 http://deb.debian.org/debian bookworm/main arm64 Packages And on the other running bullseye 32 bit: $ apt policy libvlc-dev libvlc-dev: Installed: 1:3.0.20-0+rpt1+deb11u1 Candidate: 1:3.0.20-0+rpt1+deb11u1 Version table: *** 1:3.0.20-0+rpt1+deb11u1 500 500 http://archive.raspberrypi.org/debian bullseye/main armhf Packages 100 /var/lib/dpkg/status 3.0.20-0+deb11u1+rpi1 500 500 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages $ find /usr/lib -name libvlc.so /usr/lib/arm-linux-gnueabihf/libvlc.so >Make sure you have libvlc-dev installed on the rpi. >This should install a symlink libvlc.so somewhere below /usr/lib On the bullseye system: $ find /usr/lib -name libvlc.so /usr/lib/arm-linux-gnueabihf/libvlc.so On the bookworm 64 system: $ find /usr/lib -name libvlc.so /usr/lib/aarch64-linux-gnu/libvlc.so Are these locations that will let the application (or Lazaur/Fpc) find the libraries? What are the requirements for the executable's environment for it to find the libvlc files? And is it necessary for them to be there for the building process only or for the end user's execution too? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] PasLibVLC based video player does not run on Linux...
As I have written in other posts I am trying to port a video application from Windows to Linux, specifically on Raspberry Pi4B with either bullseye or bookworm operating systems. The application runs very well on Windows and is based on PasLibVLC found here: https://prog.olsztyn.pl/paslibvlc/ But I am not able to make it show videos on Linux.. So as a test I have now reverted to a demo application on this website in order to minimize the possible problems: http://lazplanet.blogspot.com/2018/01/how-to-make-simple-video-player-in.html When I follow these instructions to create a test application on the RPi4B it builds but when executed the video window does not appear and no video can be played. Instead of a black player waiting for rthe file to play, there is a gray background just like the player was not created at all. If I copy the sources from RPi4B to my Windows10 PC and open the project in Lazarus there (same version 2.2.6) it builds fine, and in this case it also displays the video as expected. No problems there at all. Same sources. So something is not working in the Linux environment and I don't understand what. And whatever it is it does not generate any errors during compile/build on Linux. I *have* enabled the threading system in the project file by putting cthreads into the uses clause as first item so it is not a thread initializatiuon problem: {$IFDEF UNIX} cthreads, {$ENDIF} Now I am wondering if it perhaps cannot find the VLC *libraries* that are supposed to be available on a system with VLC installed. But I do not know how thatr is supposed to work and I don't understand the code either. All my Linux systems (with a GUI) can run VLC OK and display mp4 videos just fine with the VLC player application. But only on Windows10 is it working when using PasLibVlc in the test application. Any ideas? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] LclVLC usage questions for switching from PasLibVLC
On Sun, 19 Nov 2023 14:50:34 +0100, Bo Berglund via lazarus wrote: >Lazarus contains LibVLC as a standard package available to be installed in the >GUI using Package/Install-remove packages! No download needed from external >sources! >Anyway, I have been experimenting with the example inside the package code and >also read Michael's document "Displaying video files using Free Pascal and >Lazarus". > >I think I can switch out PasLibVLC and replace it with the LclVLC player >instead >but I need some help in implementation. > >There are some functions I would like to get hints on how to implement: > >1) Progressbar update >- THIS IS NOW SOLVED! I added a TThread.Create... statement as I found in the document, without really understanding how it can help. Seems to me like creating a thread that immediately exits. What can that do? And I also added an FPlayer.UseEvents statement. This is how it now looks and it does allow the events to fire... procedure TfrmMainVlc.FormCreate(Sender: TObject); begin With TThread.Create(False) do Terminate; //Initialize the treading system?? FPlayer:=TLCLVLCPlayer.Create(Self); FPlayer.ParentWindow:=PVideo; FPlayer.OnPositionChanged:=@DoPositionChanged; FVideoFile := ReadIniString('Files', 'LastVideo', ''); FEVideo.FileName := FVideoFile; FEVideo.InitialDir := ExtractFileDir(FVideoFile); tbVolume.Position := ReadIniInt('Settings', 'Volume', 10); FPlayer.UseEvents:=True; end; The next item is the handling of the progress bar: It now looks like this and works: procedure TfrmMainVlc.DoPositionChanged(Sender: TObject; const APos: Double); var VPos: integer; begin VPos := Round(APos * pgbVideopos.Max); pgbVideopos.Position := VPos; end; > >2) Reposition video via progressbar >--- This is also now working as follows: //Mouse up on progressbar should reposition the video to the clicked pos procedure TfrmMainVlc.pgbVideoposMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var VidPos: int64; Duration: int64; begin Duration := FPlayer.VideoLength div 1000; VidPos := Round(X / pgbVideopos.Width * pgbVideopos.Max * Duration); FPlayer.VideoPosition := VidPos; end; However the progressbar does not immediately reposition to the clicked position, instead it takes a second or so while it moves stepwise across. How can I make that instantaneous? >3) Increase/decrease playback speed? > >Is it possible to adjust the playback speed (I can do this with PasLibVLC)? >Then how can it be done, say to enter a percentage between 50 and 200 in a box >and then tell the player to use that setting. > In the original code using PasLibVLC it is done like this: procedure TfrmMain.btnFFClick(Sender: TObject); begin vlcPlayer.SetPlayRate(speSpeed.Value); end; And here the progressbar position is immediately changed to the target position below the mous pointer. >4) Lipsync adjust >- >Is it possible to shift the audio forward/backward relative to the image in >order to adjust lip sync? I can do this with PasLibVLC, but how can it be done >here? In the original code again it works and is done like shown below where the spinedit speAudio contains a value in milliseconds but the command expects microseconds, hence the multiplication by 1000: //For testing purposes, delay audio by the value from speAudio procedure TfrmMain.btnShiftAudioClick(Sender: TObject); var SyncCmd: string; begin vlcPlayer.SetAudioDelay(speAudio.Value *1000); //Convert to us SyncCmd := FormatAudioSyncCmd(-1 * speAudio.Value, FVideoFile); Clipboard.AsText := SyncCmd; //Ffmpeg command to modify file if needed end; Here I put the SyncCmd on the clipboard so it can be pasted into an SSH command window for ffmpeg to modify the video file itself if needed. This file modification is done after checking the effect inside the video player first, in the player whatever shift is applied is immediately there to check... Items 3 & 4 are still unsolved, how can it be done? Still hoping for suggestions on how to get this to work! -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] LclVLC usage questions for switching from PasLibVLC
On Sun, 19 Nov 2023 14:50:34 +0100, Bo Berglund via lazarus wrote: >procedure TfrmMainVlc.FormCreate(Sender: TObject); >begin > FPlayer:=TLCLVLCPlayer.Create(Self); > FPlayer.ParentWindow:=PVideo; > FPlayer.OnPositionChanged:=@DoPositionChanged; //Set event handler > FVideoFile := ReadIniString('Files', 'LastVideo', ''); //Get last video name > FEVideo.FileName := FVideoFile; > tbVolume.Position := ReadIniInt('Settings', 'Volume', 10); //Get last volume >end; Sorry, in actual fact I have this in the FormCreate: procedure TfrmMainVlc.FormCreate(Sender: TObject); begin FPlayer:=TLCLVLCPlayer.Create(Self); FPlayer.ParentWindow:=PVideo; FPlayer.OnPositionChanged:=@DoPositionChanged; FVideoFile := ReadIniString('Files', 'LastVideo', ''); FEVideo.FileName := FVideoFile; tbVolume.Position := ReadIniInt('Settings', 'Volume', 10); FPlayer.UseEvents:=True; // Enable events end; The last line was added *after* I copied the function to the list message -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] LclVLC usage questions for switching from PasLibVLC
I created a video editing tool back in 2018 or so in order to help pinpointing cut points for editing mp4 videos. At the time I did not find anything useful other than PasLibVLC, which I have been using since then on Windows. It works OK for what I need but I have to install the custom package into the IDE every time I make a new Lazarus installation. Until now I have only been on Windows with this application. A few days ago I wanted to build the application on a Linux system, but even though it compiled after I removed some Windows-only experimental functions it did not actually display the video, nothing at all shows up So I have been looking around for a solution and yesterday I found what is right under my nose: Lazarus contains LibVLC as a standard package available to be installed in the GUI using Package/Install-remove packages! No download needed from external sources! Really very neat and simple to get going and to rely upon going forward! Anyway, I have been experimenting with the example inside the package code and also read Michael's document "Displaying video files using Free Pascal and Lazarus". I think I can switch out PasLibVLC and replace it with the LclVLC player instead but I need some help in implementation. There are some functions I would like to get hints on how to implement: 1) Progressbar update - It is decribed how to make a progressbar show the current position of the video playback. That is event driven AFAICT. And it is shown in the doc... However, I don't understand what is going on in the pdf doc regarding getting the actual position shown by the position of the progressbar. I have tried to get the info from the player like this, but it won't work at all, it looks like the DoPositionChanged() event code does not get called.. This is what I have done: procedure TfrmMainVlc.FormCreate(Sender: TObject); begin FPlayer:=TLCLVLCPlayer.Create(Self); FPlayer.ParentWindow:=PVideo; FPlayer.OnPositionChanged:=@DoPositionChanged; //Set event handler FVideoFile := ReadIniString('Files', 'LastVideo', ''); //Get last video name FEVideo.FileName := FVideoFile; tbVolume.Position := ReadIniInt('Settings', 'Volume', 10); //Get last volume end; procedure TfrmMainVlc.DoPositionChanged(Sender: TObject; const APos: Double); var nCurrPos: int64; begin //Just print the position to screen as first test nCurrPos := Round(APos); //Position in ms stxPos.Caption := IntToStr(nCurrPos); //Show position in StaticText box end; Nothing at all happens when I play the video, the event function is not called. 2) Reposition video via progressbar --- I also need the reverse, i.e. when I click the progressbar I want the video to be repositioned to the place I clicked. And this I have solved using this piece of code (note: I have set the progressbar max value to 1000 to get better resolution: //Mouse up on progressbar should reposition the video to the clicked pos procedure TfrmMainVlc.pgbVideoposMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var VidPos, Duration: int64; begin Duration := FPlayer.VideoLength div 1000; VidPos := Round(X / pgbVideopos.Width * pgbVideopos.Max * Duration / 1000); FPlayer.VideoPosition := Round(VidPos * 1000); end; 3) Increase/decrease playback speed? Is it possible to adjust the playback speed (I can do this with PasLibVLC)? Then how can it be done, say to enter a percentage between 50 and 200 in a box and then tell the player to use that setting. 4) Lipsync adjust - Is it possible to shift the audio forward/backward relative to the image in order to adjust lip sync? I can do this with PasLibVLC, but how can it be done here? Grateful for any suggestions on how to get this to work! -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] How to generate the fppkg.cnf file which Lazarus complains about when starting?
On Thu, 16 Nov 2023 18:49:46 +0100, Bo Berglund via lazarus wrote: >On Thu, 16 Nov 2023 16:49:25 +0100, Werner Pamler via lazarus > wrote: > >>Am 16.11.2023 um 13:30 schrieb Bo Berglund via lazarus: >>> 2) Retrieve the Lazarus 2.2.6 sources from GitLab >>IIRC, the fppkg check has been by-passed by Laz 3.0. So, please try to >>install the RC2 of v3, or a wait a short time until the final version >>will be released. > >OK, will wait then. > Or rather, I downloaded the 3.0.RC2 sources and built another Lazarus on the RPi4. This was different, no longer the ask for the fppkg.cnf file! So I guess I can let that issue rest for now. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] How to generate the fppkg.cnf file which Lazarus complains about when starting?
On Thu, 16 Nov 2023 16:49:25 +0100, Werner Pamler via lazarus wrote: >Am 16.11.2023 um 13:30 schrieb Bo Berglund via lazarus: >> 2) Retrieve the Lazarus 2.2.6 sources from GitLab >IIRC, the fppkg check has been by-passed by Laz 3.0. So, please try to >install the RC2 of v3, or a wait a short time until the final version >will be released. OK, will wait then. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] How to generate the fppkg.cnf file which Lazarus complains about when starting?
On Thu, 16 Nov 2023 14:27:27 +0100, John Landmesser via lazarus wrote: >Am 16.11.23 um 13:30 schrieb Bo Berglund via lazarus: >> I have installed Lazarus on a Raspberry Pi4B running bookworm 64 bit >> operating >> system. >> I first tried to use fpcupdeluxe to do it but it fails miesrably with a >> linker >> error when building fpc. >> So then I decided to try the following: >> 1) Use apt install fpc to getb the latest 3.2.2 compiler installed. >> 2) Retrieve the Lazarus 2.2.6 sources from GitLab >> 3) Then run the make clean && make bigide inside the Lazarus source dir >> 4) Finally create the $HOME/.local/share/applications/lazarus_2.2.6.desktop >> launcher file >> >> This succeeded and after I had created the desktop file for Lazarus in step >> 4 it >> appeared in the RPi4 main menu under Programming. >> >> But when I started it it complains about not finding fppkg.cfg and sure >> enough >> there is no such file to be found, at least not in the locations I have seen >> before. >> >> So apparently it has not been created or is in some obscure loication not >> known >> by me. >> >> My Lazarus resides in $HOME/devtools/lazarus/2.2.6 and fpc has been placed in >> /usr/bin/fpc. >> >> But I cannot find a file named fppkgh.cfg whereever I look... >> >> What to do now? >> >> Lazarus runs and I can add IDE packages and rebuild Lazarus just fine but >> whenever it starts up it shows the dialog requesting the location of >> fppkg.cfg... >> >> > > >On my Manjaro linux the file in question are located in two places: > >[john1@manjaro lazarus]$ locate -i fppkg.cfg >*/etc/fppkg.cfg* > >*... with this contrent* > >** > >> *[Defaults] >> ConfigVersion=5 >> LocalRepository={UserDir}.fppkg/ >> BuildDir={LocalRepository}build/ >> ArchivesDir={LocalRepository}archives/ >> CompilerConfigDir=/etc/fppkg >> RemoteMirrors=https://www.freepascal.org/repository/mirrors.xml >> RemoteRepository=auto >> CompilerConfig=default >> FPMakeCompilerConfig=default >> Downloader=FPC >> InstallRepository=user >> >> [Repository] >> Name=fpc >> Description=Packages which are installed along with the Free Pascal >> Compiler >> Path=/usr/lib/fpc/{CompilerVersion}/ >> Prefix=/usr/lib/fpc/../../ >> >> [IncludeFiles] >> FileMask=/etc/fppkgconf.d/*.conf >> >> [Repository] >> Name=user >> Description=User-installed packages >> Path={LocalRepository}lib/fpc/{CompilerVersion} >> Prefix={LocalRepository} >> * >* >* > >*/usr/lib/fpc/src/utils/fpcmkcfg/fppkg.cfg* None of these locations exist on my device. However, Lazarus works (built from sources) as does fpc (installed via apt) The only problem ius that I get this annoying pop-up every time I start Lazarus... > >Perhaps this command tells you more? > >[john1@manjaro lazarus]$*./lazarus --setup* What is that supposed to do? I don't want to run an unknown command after spending so much time finally getting Lazarus working... NOTE: ffpkg seems not to be a recognized command... And the file I found here is also not accepted: https://forum.lazarus.freepascal.org/index.php/topic,60994.msg457678.html#msg457678 -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] How to generate the fppkg.cnf file which Lazarus complains about when starting?
I have installed Lazarus on a Raspberry Pi4B running bookworm 64 bit operating system. I first tried to use fpcupdeluxe to do it but it fails miesrably with a linker error when building fpc. So then I decided to try the following: 1) Use apt install fpc to getb the latest 3.2.2 compiler installed. 2) Retrieve the Lazarus 2.2.6 sources from GitLab 3) Then run the make clean && make bigide inside the Lazarus source dir 4) Finally create the $HOME/.local/share/applications/lazarus_2.2.6.desktop launcher file This succeeded and after I had created the desktop file for Lazarus in step 4 it appeared in the RPi4 main menu under Programming. But when I started it it complains about not finding fppkg.cfg and sure enough there is no such file to be found, at least not in the locations I have seen before. So apparently it has not been created or is in some obscure loication not known by me. My Lazarus resides in $HOME/devtools/lazarus/2.2.6 and fpc has been placed in /usr/bin/fpc. But I cannot find a file named fppkgh.cfg whereever I look... What to do now? Lazarus runs and I can add IDE packages and rebuild Lazarus just fine but whenever it starts up it shows the dialog requesting the location of fppkg.cfg... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazartus on RaspberryPi 64 bit - build for all RPi versions?
On Wed, 15 Nov 2023 21:53:11 +0100, Bo Berglund via lazarus wrote: >I refer the discussion over to the Lazarus forum (see link above). Just a quick follow-up here: It seems like the fpc sources have not been updated with the solution to the bug discussed here: https://gitlab.com/freepascal.org/fpc/source/-/issues/39295 THis causes the build of Lazarus using fpcupdeluxe with the latest fpc 3.2.2 to fail because of a problem with __libc_csu_init during linking. Apparently it is fixed in non-released sources of fpc which we are waiting for... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazartus on RaspberryPi 64 bit - build for all RPi versions?
On Wed, 15 Nov 2023 20:25:58 +0300, Alexey Torgashin via lazarus wrote: >> then I have to use fpcupdeluxe to install Lazarus + FPC then. > >Lazarus can be old. Only FPC need to be installed from Deluxe. Old >Lazarus - in it, specify path for new FPC. >Alex I asked on the Lazarus forum as well, my first post is here: https://forum.lazarus.freepascal.org/index.php/topic,34645.msg496844.html#msg496844 It seems like the fpcupdeluxe available for armhf on GitHub does not run in PiOS 64 bit. It is a 32 bit application... NOTICE! I was alerted to using the wrong version of fpcupdeluxe, it should be the aarch64-linux version!!! With this version downloaded it tstarts running OK and I can configure and start building. But it fails after about 10 minutes complaining about this: make[1]: *** [Makefile:2682: packages_smart] Error 2 make: *** [Makefile:2837: build-stamp.aarch64-linux] Error 2 fpmake.pp(60) Error: Error while linking fpmake.pp(60) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted fpcupdeluxe: ERROR: FPC Native Installer (BuildModule: FPC): Error running /usr/bin/make for FPC failed with exit code 512 . Details: . ERROR: Fpcupdeluxe fatal error ! Sequencer (FPC): Failure running fpcupdeluxe: error executing sequence FPC Sequencer (Default): Failure running fpcupdeluxe: error executing sequence Default I refer the discussion over to the Lazarus forum (see link above). -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazartus on RaspberryPi 64 bit - build for all RPi versions?
On Wed, 15 Nov 2023 19:52:51 +0300, Alexey Torgashin via lazarus wrote: >fpcUpDeluxe allows to install additional FPC folder. with 'crosses' - >for ex, I have additional FPC on Linux with crosses for Windows, Linux >ARM, *BSD x32+x64, macOS x64+ARM. In the IDE you can specify that new >FPC installation. Using IDE 'build modes' you can make N new modes, one >mode pear each CPU/OS case. >Alex OK thanks, then I have to use fpcupdeluxe to install Lazarus + FPC then. I will try that as a first on the new RPi4 then. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Lazartus on RaspberryPi 64 bit - build for all RPi versions?
I have now installed the 64 bit version of PiOS on an RPi4B device. If I install Lazarus/FPC on that can it create applications both for 32 and 64 bit RPi operating systems? Or do I have to install two versions of Lazarus and/or FPC to be able to do that? It would be nice to have only one Lazarus but both 64 and 32 bit FPC compilers and be able to select for which I want to build the application inside Lazarus itself. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] MJPEG streamer
On Sun, 23 Jul 2023 18:35:05 +1000, Steve Gatenby via lazarus wrote: >Would anybody know if there is a component / code to enable reading an >mjpeg stream from a http camera to a Lazarus form/panel (or anything really) > >Dont mind installing libraries etc - > >Looking to suit Linux specifically though > >Thanks - SteveG I have been using PasLibVlc from here: https://prog.olsztyn.pl/paslibvlc/ in order to read/display/navigate mp4 video files in an editing application I wrote a number of years ago. It works very well on both Windows and Linux (Ubuntu and RaspberryPiOS). The only requirement I am aware of is that VLC must be installed on the development (and host) machines. It is a bit old now (last update from 2020-07-05), but works just fine for me. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Cannot use bookmarks in code window - why?
On Sun, 23 Apr 2023 19:55:48 +0200, Martin Frb via lazarus wrote: >On 23/04/2023 19:39, Bo Berglund via lazarus wrote: >> I have started a new project in Lazarus 2.2.6/Fpc3.2.2 on a Linux machine >... >> I have looked at the same version of Lazarus on my Windows workstation and >> there >> when I right-click the gutter to the left of the code there is a popup menu >> with >> "Goto Bookmark" and "Toggle Bookmark" and when I click one of these a >> secondary >> menu pops up with further alternative of where to go etc. >> >> But on the RPi4 (via VNC) there is *nothing* happening if I click on any of >> the >> two bookmark related lines in the first pop-up menu >> No secondary menu shows up at all... >> > > >There was an issue that has been fixed for Lazarus 2.4 (i.e. in 2.3). >It is possible that the fix wasn't backported for some reason. > >Though currently we have reports that there may be individual cases >were the problem persists in 2.3. >However despite lots of testing, this has not been reproducible. So the >status is unknown. > >You can set bookmarks using > shift-ctrl-1 .. 0 >and go to them > ctrl-1 .. 0 > >Assuming your OS/Desktop has no shortcuts on those combos. >If there is a conflict, you can change the Desktop, or Lazarus. Thanks, that worked fine! Any timetable for Lazarus 2.4.0 release? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Cannot use bookmarks in code window - why?
I have started a new project in Lazarus 2.2.6/Fpc3.2.2 on a Linux machine (RaspberryPi4). I installed Laz/Fpc using fpcupdeluxe if that matters. Now I have gotten to a project size that really needs the ability to set/clear/jumpto bookmarks. But I have found no way to set a bookmark here! I am pretty sure they were there some years ago when I last worked on a sizable project with an earlier version of Lazarus on RPi. My environment is: Host: Linux on RaspberryPi4 with the latest version of PiOS (bullseye) VNC server is enabled on the RPi4 for desktop access. Desktop: The Rpi4 is headless (i.e. no monitor) and I access it via RealVNC from my Windows 10 workstation. This works well mostly. How can I: - Set a bookmark - Clear a bookmark - Jump to a bookmark I have looked at the same version of Lazarus on my Windows workstation and there when I right-click the gutter to the left of the code there is a popup menu with "Goto Bookmark" and "Toggle Bookmark" and when I click one of these a secondary menu pops up with further alternative of where to go etc. But on the RPi4 (via VNC) there is *nothing* happening if I click on any of the two bookmark related lines in the first pop-up menu No secondary menu shows up at all... Is there a setting somewhere, which I have missed, to enable bookmarks or such? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Code editor column mode does not work...
On Wed, 19 Apr 2023 21:50:07 +0200, Marco van de Voort via lazarus wrote: > >On 19-4-2023 19:24, Martin Frb via lazarus wrote: >> >> Sounds like the OS / desktop manager grabs the mouse first. >> >> 2 possibilities. >> >> 1) change the OS config (if possible / I don't know) >> >> 2) Tools > Options > Editor > Mouse: assign another combo for the >> column selection >> Either diff modifier keys; or diff button. > > >3) use kbd block selection (alt-shift cursor keys) Thanks, Alt-Shift works to get me the column selection! :-) -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Is there a setting to include debug symbols when starting from Lazarus only?
On Sun, 16 Apr 2023 13:32:12 +0200, Martin Frb via lazarus wrote: > >On 16/04/2023 11:15, Bo Berglund via lazarus wrote: >> - Use Run menu Build or Compile: no symbols should be included. >> - Click the green run arrow button then the symbols will be included. > > >I think the closest you may get to this is build modes. > > >But all and any button/key/menu always use the current mode. you have to >change it via the drop down on the toolbutton. > > >projectgroups may offer a direct "build mode xxx" Fixed it by creating two build modes (Debug and Release) on suggestion from Lazarus itself in the Release dialog from Project Options. Result: When I use Release the symbols are not added and when using Debug, then the symbols are added *and* the executable name is changed to originalname.dbg. This is of course on Linux, what happens on Windows I don't know. originalname.exe.dbg would not work of course... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Code editor column mode does not work...
I am coding on a headless RaspberryPi4B via RealVNC and it works rather well from my Windows 10 workstation. But there is one item I have yet to figure out: How can I enable column selection with the mouse? If I use the Alt key and click where I want to start the selection then when I move the mouse the whole editor window moves instead of creating a vertical selection... Is there someone here who has done this and can share the solution? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange linker messages "undefined reference" when building on RPi4 - CompileLog_2022-04-15.log (0/1)
On Mon, 17 Apr 2023 10:32:51 +0200, Mattias Gaertner via lazarus wrote: >On Mon, 17 Apr 2023 10:11:28 +0200 >Giuliano Colla via lazarus wrote: > >> Il 17/04/2023 08:15, Bo Berglund via lazarus ha scritto: >> >> > You never stop learning! >> >> Another thing I have learned with experience, is that sometimes the >> cleanup isn't perfect and leaves some dangling ppu which creates a >> problem like the one you had. It occurred to me when attempting to >> rebuild Lazarus, and I was getting an unexpected "undefined >> reference". > >Can happen when some unit is moved to another package. > >> I was trying to build a normal IDE, so I tried to build a >> "debug IDE" instead. With different compilation flags it was forced >> to rebuild everything, and it worked fine. Then I tried again a >> "normal IDE", and this time it went OK. > >That's why there is "Clean all" radiobutton on the configure build >lazarus dialog. It building fails, try that. > Please can you describe where exactly I can find this on Lazarus 2.2.6? I don't know where I find "Configure build", is it a project option or a global settings (Below menu Project or Tools)? If I look at the Run menu I see very far down "Configure Build+Run File...", but that does not sound like what you are discussing, right? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange linker messages "undefined reference" when building on RPi4 - CompileLog_2022-04-15.log (0/1)
On Sun, 16 Apr 2023 20:25:18 +0200, Jean SUZINEAU via lazarus wrote: >Unfortunately my lazarus is installed in French , I don't have the exact >label of the menu item in English, > >But usually for this kind of problem I use "Nettoyer et construire" in >"Exécuter" menu. > >I imagine that in English it's something like "Clean and build" in "Run" >menu. > >In this dialog you can tune what compiled files you want to delete in >the various dependencies. Right you are! :-) I should have looked further down in the Run menu... The English name is: Clean up and Build That should have done it in the first place... You never stop learning! -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange linker messages "undefined reference" when building on RPi4 - CompileLog_2022-04-15.log (0/1)
On Sun, 16 Apr 2023 10:58:18 +0200, Bo Berglund via lazarus wrote: >And now the project as checked out via subversion builds fine and works as it >should. It builds both on Windows10 and on RaspberryPi4. > >So the errors I had before must be related to the older operating system >(buster) and some missing dependencies maybe. Well, this was *not* the main reason it turns out... What I had done was to install the newest Lazarus/Fpc and opening the existing project in lazarus. When I use the Quick Compile it does apparently only compile the source files and finishes OK. But with Build/Compile it does the same but then it jumps into the linker without also compiling the dependencies, which are present in the lib directory but from the *earlier* versions... I ran into this also on the newly installed RPi4 with bullseye Linux and then realized what was going on because here I had two projects, one that had been built previously and one that hadn't and the latter worked just fine as reported above. Both were copied over from the old system SD-card... So what I did now was to delete the lib dir below the project dir and now the Build/Compile works just fine! It is recreated with fresh files. So to keep in mind: Make sure to remove any project subdirs autocreated by Lazarus/Fpc when migrating a project folder. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Is there a setting to include debug symbols when starting from Lazarus only?
Las 2.2.6/Fpc 3.2.2 I use the config item: Project/ProjectOptions/CompilerOptions/Debugging/GenerateInfoForTheDebugger in order to include symbols or not in the executable. Now I wonder if there is some way to configure this such that it works like this: - Use Run menu Build or Compile: no symbols should be included. - Click the green run arrow button then the symbols will be included. I know there is a button next to the green arrow that has a little red x and the hint: "Run without debugging" But I think this is just for the execution of the program without the debugger, right? Or is this working such that both green arrows will add the debug info but only the one without the x will actually *use* the debugger? I would like to be able to build the release without symbols from the Run menu but still use the green arrow to debug without having to change the setting above. Is this possible? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Strange linker messages "undefined reference" when building on RPi4 - CompileLog_2022-04-15.log (0/1)
On Sat, 15 Apr 2023 13:41:57 +0200, Bo Berglund via lazarus wrote: >I have a project that builds fine on one RPi4 where I have installed Lazarus >2.2.6/Fpc 3.2.2 from sources. >This is a rather old device and I am trying to create a backup build unit to >migrate into >On this I have installed the same versions but using fpcupdeluxe for arm-linux. > >On the new unit some test projects work fine but the real target project seems >to have some problems. > >I have retrieved the same project from our Subversion server so the project >files are the same versions. >On the original RPi4 I can compile/build/debug just fine. > >But when I try compiling or building the project on the newer RPi4 I get the >output below in the messages log (the full log as copied from Lazarus >attached). > >The problem seems to come from the Synapse package but this is installed via >OnlinePackageManeger on both systems... >What does this mean: > >undefined reference to `SYSTEM_$$_POS$CHAR$RAWBYTESTRING$$LONGINT' > >And what can I do? Is something missing in the fpcupdeluxe installation? >This has not happened to me before. So I gave up on this and decided to build a new development device using the same RPi4 but with a fresh SD-card with the latestr PiOS bullseye version. After setting up the pi itself and installing the build requirements for Lazarus/Fpc I could use fpcupdeluxe arm-linux to install the Lazarus 2.2.6/Fpc 3.2.2 combo and set it up using OLPM the way I always do. This includes installing Synapse40 as well as a number of other packages from my list, which I always use. And now the project as checked out via subversion builds fine and works as it should. It builds both on Windows10 and on RaspberryPi4. So the errors I had before must be related to the older operating system (buster) and some missing dependencies maybe. In any case I am good to go now. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Strange linker messages "undefined reference" when building on RPi4 - CompileLog_2022-04-15.log (0/1)
I have a project that builds fine on one RPi4 where I have installed Lazarus 2.2.6/Fpc 3.2.2 from sources. This is a rather old device and I am trying to create a backup build unit to migrate into On this I have installed the same versions but using fpcupdeluxe for arm-linux. On the new unit some test projects work fine but the real target project seems to have some problems. I have retrieved the same project from our Subversion server so the project files are the same versions. On the original RPi4 I can compile/build/debug just fine. But when I try compiling or building the project on the newer RPi4 I get the output below in the messages log (the full log as copied from Lazarus attached). The problem seems to come from the Synapse package but this is installed via OnlinePackageManeger on both systems... What does this mean: undefined reference to `SYSTEM_$$_POS$CHAR$RAWBYTESTRING$$LONGINT' And what can I do? Is something missing in the fpcupdeluxe installation? This has not happened to me before. Log excerpt follows: First this happens in the output: -- Note: Duplicate unit "synautil" in "SSRemoteServerLx", orphaned ppu "/home/pi/projects/SSRemoteServer/source/lib/arm-linux/synautil.ppu" Note: Duplicate unit "synautil" in "laz_synapse 40.1", ppu="/home/pi/LazFpc/Laz_2.2.6/config_lazarus/onlinepackagemanager/packages/synapse40.1/lib/arm-linux/synautil.ppu", source="/home/pi/LazFpc/Laz_2.2.6/config_lazarus/onlinepackagemanager/packages/synapse40.1/synautil.pas" Note: Duplicate unit "synaser" in "SSRemoteServerLx", orphaned ppu "/home/pi/projects/SSRemoteServer/source/lib/arm-linux/synaser.ppu" Note: Duplicate unit "synaser" in "laz_synapse 40.1", ppu="/home/pi/LazFpc/Laz_2.2.6/config_lazarus/onlinepackagemanager/packages/synapse40.1/lib/arm-linux/synaser.ppu", source="/home/pi/LazFpc/Laz_2.2.6/config_lazarus/onlinepackagemanager/packages/synapse40.1/synaser.pas" Note: Duplicate unit "synafpc" in "SSRemoteServerLx", orphaned ppu "/home/pi/projects/SSRemoteServer/source/lib/arm-linux/synafpc.ppu" Note: Duplicate unit "synafpc" in "laz_synapse 40.1", ppu="/home/pi/LazFpc/Laz_2.2.6/config_lazarus/onlinepackagemanager/packages/synapse40.1/lib/arm-linux/synafpc.ppu", source="/home/pi/LazFpc/Laz_2.2.6/config_lazarus/onlinepackagemanager/packages/synapse40.1/synafpc.pas" Note: Duplicate unit "fpserialport" in "SSRemoteServerLx", orphaned ppu "/home/pi/projects/SSRemoteServer/source/lib/arm-linux/fpserialport.ppu" Note: Duplicate unit "fpserialport" in "fpserialpkg 0.0", ppu="/home/pi/LazFpc/Laz_2.2.6/config_lazarus/cmplaz/FpSerialPort/lib/arm-linux/fpserialport.ppu", source="/home/pi/LazFpc/Laz_2.2.6/config_lazarus/cmplaz/FpSerialPort/fpserialport.pas" Then some hints on unused variables for the units being compiled etc... Then this: /home/pi/projects/SSRemoteServer/source/SSRemoteServerLx.lpr(32,5) Hint: (5023) Unit "BaseUnix" not used in SSRemoteServerLx (9022) Compiling resource /home/pi/projects/SSRemoteServer/source/lib/arm-linux/SSRemoteServerLx.or (9015) Linking /home/pi/projects/SSRemoteServer/source/SSRemoteServerLx /usr/bin/ld: //home/pi/projects/SSRemoteServer/source/lib/arm-linux/synautil.o: in function `SYNAUTIL_$$_finalize_implicit$': /home/pi/projects/SSRemoteServer/source/synautil.pas:(.text.n_synautil_$$_decodetimezone$ansistring$longint$$boolean+0x68): undefined reference to `SYSTEM_$$_POS$CHAR$RAWBYTESTRING$$LONGINT' /usr/bin/ld: /home/pi/projects/SSRemoteServer/source/synautil.pas:(.text.n_synautil_$$_decodetimezone$ansistring$longint$$boolean+0x7c): undefined reference to `SYSTEM_$$_POS$CHAR$RAWBYTESTRING$$LONGINT' /usr/bin/ld: /home/pi/projects/SSRemoteServer/source/synautil.pas:(.text.n_synautil_$$_decoderfcdatetime$ansistring$$tdatetime+0x1cc): undefined reference to `SYSTEM_$$_POS$CHAR$RAWBYTESTRING$$LONGINT' /usr/bin/ld: /home/pi/projects/SSRemoteServer/source/synautil.pas:(.text.n_synautil_$$_dump$ansistring$ansistring+0x60): undefined reference to `SYSUTILS_$$_FILEEXISTS$RAWBYTESTRING$$BOOLEAN' /usr/bin/ld: /home/pi/projects/SSRemoteServer/source/synautil.pas:(.text.n_synautil_$$_dumpex$ansistring$ansistring+0x60): undefined reference to `SYSUTILS_$$_FILEEXISTS$RAWBYTESTRING$$BOOLEAN' This goes on for a while until: /home/pi/projects/SSRemoteServer/source/class_SSRemoteClientComm.pas(290,3) Hint: (5028) Local const "DLE" is not used /home/pi/projects/SSRemoteServer/source/class_SSRemoteClientComm.pas(283,3) Hint: (5023) Unit "IniFileFuncs" not used in class_SSRemoteClientComm /home/pi/projects/SSRemoteServer/source/SSRemoteServerLx.lpr(32,5) Hint: (5023) Unit "BaseUnix" not used in SSRemoteServerLx Now the compile is done an link starts -- (9022) Compiling resource /home/pi/projects/SSRemoteServer/source/lib/arm-linux/SSRemoteServerLx.or (9015) Linking /home/pi/projects/SSRemoteServer/source/SSRemoteServerLx /usr/bin/ld: //home/pi/pr
[Lazarus] Lazarus 2.2.6/Fpc 3.2.2 Win-32 - Cannot add desktops, why?
I was following my notes on how to configure a newly installed Lazauus to my liking when I stumbled across an item I have not seen AFAICT: Normally I configure different desktops to use for different types of application, for example the one for standard GUI applications is different from what I use for console type programs. So I installed the 32 bit Lazarus on a Windows 10 x64 workstation using fpcupdeluxe (the reason for 32 bit is because I need that to be able to cross-compile for Raspberry Pi arm devices). I also installed the cross-compiler for arm-linux (the cross to Win64 was already installed when I installed the main Lazarus-32). When I now headed towards the desktop dialog (Tools/Desktops) it does not have an option to add new desktops! The only functions available on the "Manage Desktops" dialog are: - Save active desktop as.. - Set active (disabled) - Toggle as debug desktop - Rename - Delete (disabled) - Move up (disabled) - Move down - Auto save active desktop checkbox is checked by default. I am used to getting into a dialog where one can add new desktops and name them whatever, then set one active and configure the desktop as needed and save it, then move to the next desktop and repeat. But this is not possible here! What am I missing? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] AutoSave does not save project file...
On Thu, 20 May 2021 21:10:10 +0200, Bo Berglund via lazarus wrote: >On Sun, 11 Apr 2021 11:29:36 +0200, Bo Berglund via lazarus > wrote: > >>I have installed AutoSave from the OnlinePackageManager on all of my numerous >>Lazarus installations and in general it works well. >>I started to do this following several Lazarus crashes where I lost modified >>code and had to try restoring from memory... >> >>However, when I write console (simple program) applications I have noted that >>AutoSave does not save the lpr file! And when looking closely the lpi file in >>GUI apps is also not saved. >> >>Since lpr is the only file in simple programs AutoSave does not help from >>disaster if a crash happens. >>Is there a way to configure or modify AutoSave so it also saves the main >>project >>files? >> > >Reviving this thread in order to find a solution (did not get a single reply). >-- >I am relying heavily on AutoSave when programming in Lazarus on a remote >RaspberryPi via VNC connection. In this situation it happens way too often that >Lazarus suddenly just unloads from memory and I see a blank desktop. >Thanks to AutoSave in most cases I have just to start Lazarus again to be back >in business, at worst with the last 5 seconds of typing lost. > >But that does not hold true if I am working in the lpr file because that is not >saved automatically!!! > >It just happened to me again and it causes problems trying to re-create the >last >hour or so of work done on this file. :( > >So I would REALLY be happy if someone who understands the workings of AutoSave >can make it include the project file among the files saved by AutoSave! > >I have never ever looked at stuff that integrate within Lazarus itself so I >could not fix it Now I have looked at the GitHub code, but am none the wiser (or a little bit wiser)... >For a console program maybe I should create a mainprogram.pas file and put >*everything* now located in the lpr file into that instead? >Just leave a bare minimum in the lpr file... >Pity to be forced to do that though. > As Juha Manninen suggested I have looked at the Autosave code in GitHub and I found this to be where the action is triggered: The file is: https://github.com/lainz/LazAutoSave/blob/master/autosave_main.pas And this is the function that does the job (starts at line #107): procedure TAutoSave.OnTimer(Sender: TObject); begin if Settings = nil then begin if LazarusIDE <> nil then //wait until IDE startup begin Settings := TSettings.Create(AppendPathDelim(LazarusIDE.GetPrimaryConfigPath) + cAutoSaveConfigFile); FTimer.StopTimer; FTimer.Interval := Settings.AutoSaveInteval*1000; FTimer.StartTimer; end; end else begin if Settings.EnableAutoSave then LazarusIDE.DoSaveAll([sfDoNotSaveVirtualFiles, sfCanAbort, sfQuietUnitCheck]); //<== Does *not* save the project lpr file! end; end; Notice that it calls LazarusIDE itself and I have no idea how to make Lazarus include the lpr file into the ones being saved by this call... There *must* be some setting for this in Lazarus, right? So how can I tell Lazarus to include the lpr file in the saved files when it is called this way? I am still experiencing these regular crashes in Lazarus even when using the version 2.2.6 with Fpc 3.2.2 on a RaspberryPi4B 8GB device. I access the desktop with VNC, which may be why the crash happens. Typically Lazarus disappears when I accidentally click the mouse on something in the IDE, but I don't understand exactly what is clicked. Could be some border in the editor or such, but Lazarus instantly disappears and I look at a blank desktop... However, Autosave has saved the day for me because when it happens I can just start Lazarus again and I am back where I left off. Except of course if I am doing a command line program with all code in the lpr file, then everything is lost when the crash happens. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus/Fpc on RaspberryPi4 - linkxxx.res files stack up, why?
On Wed, 5 Apr 2023 23:06:09 +0200, John Landmesser via lazarus wrote: >Am 05.04.23 um 20:50 schrieb Bo Berglund via lazarus: >> Does someone here know what I can do in order not having my project folder >> polluted by numerous files named link.res where is a decimal number >> apparently random in nature? >> Yesterday I removed about 20 of these files and now again I have 8 new such >> files in the directory... >> >> Is there some setting I have missed in Lazarus to cause this? >> I am on Lazarus 2.2.6/Fpc 3.2.2 on an RPi4B 8GB device. >> Both are installed from sources. >> >> >I don't know the answer but if you do not use "quick compile you wiil >not have these files! > >See also https://forum.lazarus.freepascal.org/index.php?topic=60095.0 Thanks, I am using QuickCompile when dealing with big edits to pinpoint syntax errors, so I have done that rather often in my new project where I use code from GitHub, which I am not familiar with Just delete them then. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Lazarus/Fpc on RaspberryPi4 - linkxxx.res files stack up, why?
Does someone here know what I can do in order not having my project folder polluted by numerous files named link.res where is a decimal number apparently random in nature? Yesterday I removed about 20 of these files and now again I have 8 new such files in the directory... Is there some setting I have missed in Lazarus to cause this? I am on Lazarus 2.2.6/Fpc 3.2.2 on an RPi4B 8GB device. Both are installed from sources. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Simple ipc server fatal error on start - 0xc000007b
On Sat, 01 Apr 2023 09:37:00 +0200, Bo Berglund via lazarus wrote: >On Sat, 1 Apr 2023 01:58:05 +0200, Giuliano Colla via lazarus > wrote: > >>Among the internet examples of Delphi 7 you should find a small app named >>netchat, >>which provides a basic IPC. Its quite simple and bullet-proof. Ive >>converted to >>Lazarus on Linux, and used as a base for my needs of IPC. >>But converting on the same Windows environment should be very simple, just >>using >>the Lazarus facilities. You may test it just as it is, and then adapt it to >>your needs. >> >>Giuliano So I pulled out my Delphi7 CD (actually mounted the ISO copy of the CD) and managed to find the demo you refer to. It is as I suspected using the TCP/IP socket communications, but I guess this is the way I have to go. I can probably set it to only operate on the localhost interface so there is no need to get packets out onto the LAN, which may or may not be available. And I can use Indy10 sockets rather than the now since long deprecated TTcpClient and TTcpServer components. I guess I will save myself a lot of time doing this... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Simple ipc server fatal error on start - 0xc000007b
On Sat, 1 Apr 2023 01:58:05 +0200, Giuliano Colla via lazarus wrote: >Among the internet examples of Delphi 7 you should find a small app named >netchat, >which provides a basic IPC. Its quite simple and bullet-proof. Ive converted >to >Lazarus on Linux, and used as a base for my needs of IPC. >But converting on the same Windows environment should be very simple, just >using >the Lazarus facilities. You may test it just as it is, and then adapt it to >your needs. > >Giuliano > Where are the "internet examples of Delphi 7" located? Inside the Delphi7 installation or where? I can't find any. By the name you write it looks to me (without having found the example) that it is a *network* application using TCP/IP sockets or the like. I know this is a possibility but seems to be problematic since it implies that the communication is via the LAN. What about situations when there is no network connection? The IPC as described seems to use internal messaging channels on the Windows computer it runs on and not the network... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Simple ipc server fatal error on start - 0xc000007b
I am investigating the possibilities to use IPC between a Lazarus and a Delphi7 application running on Windows. I was discussing this on the Lazarus forum where I got a tip to use SimpleIPC, which apparently is delivered with the Fpc compiler itself. The tip was given in this post: https://forum.lazarus.freepascal.org/index.php/topic,62867.msg475663.html#msg475663 In that post is a link to a GitHub project which simplifies ipc usage by creating a dll packaging everything needed so that the dll could be used from other applications developed in other languages too. Sounds good to me. Here is the GitHub project url: https://github.com/z505/SimpleIPC-lib So I downloaded this and using Lazarus 2.2.4 and Fpc 3.2.2 on Windows 10 x64 I did this: 1) opened the dll project and compiled the dll itself. 2) Opened the demo-lazarus\ipcclient project and compiled it 3) Opened the demo-lazarus\ipcserver project and compiled it So now I could start the ipcclient app and it shows its form with a button to send data to the server. When I used it there was an error message about "not finding the server". To be expected, since I had not started the server... So I next tried to start the server app, but it immediately shows an error box with the text: --- Application error The application was unable to start correctly (0xc07b). Click OK to close the application. [OK] --- I have tried various things like changing target for the dll and both applications to win32 (I have the cross for Win32 installed), but the exact same happens. And I have no idea whatsoever on where to look for a reason for this to happen. I have even put a breakpoint into the server code at the earliest point I could find and started it from Lazarus, but get the same error dialog and no breakpoint reached... I tried reading https://wiki.freepascal.org/SimpleIPC but got no idea from that either... What to do now? I am not clever enough to figure out if there is some error in the GitHub project. Not used to windows communications at all. What I want to do is to create an ipc link to a Delphi7 server app from a Lazarus/fpc client app to use the D7 app to read a hardware device on command and send the data to the Lazarus app. It is not possible to compile the D7 app on Lazarus because there is a device manufacturer's obj file involved and it is apparently of the wrong format for Lazarus/Fpc to use. It can be linked to in Delphi7 but not in Lazarus/Fpc. Hence the D7<=ipc=>Lazarus IPC communication... I really do hope this can be fixed so I can get the ipc comm line to the D7 interfacing app working! -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Can older Lazarus use newer FPC?
If I already have some Lazarus versions installed when FPC stable was 3.0.4 and I later install FPC 3.2.0 or 3.2.2, can I then change the compiler to use for the older Lazarus versions to the new Fpc? If I look at the Lazarus Tools/Options/Environment/Files I see items like: Compiler executable: /home/pi/lib/fpc/3.2.0/ppcarm FPC source directory: /home/pi/dev/fpc/3.2.0 Can these be changed to point to the new FPC so the old FPC is no longer needed? Or do I have to keep the old FPC compiler around when I update it to a new version? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus Release 2.2.6
On Thu, 16 Mar 2023 20:48:29 +0100, Giuliano Colla via lazarus wrote: >Il 16/03/2023 18:46, Bo Berglund via lazarus ha scritto: > >> I have a number of Lazarus releases installed where 3.0.4 is the fpc used. >> So they all used the same and there was no problem. >> (This is on Ubuntu Linux 22.04 btw and I install everything from sources) > >I have a similar problem, needing to give assistance to customers with >different Lazarus versions. >It's very annoying to maintain a program developed with an older >version, and to make a minor correction, to be obliged to update a lot >of other things which have been deprecated in the time between. >My solution has been to use fpcupdeluxe. It provides a fully self >contained set of Lazarus + fpc, which doesn't clash with anything else. >Both Lazarus config and all of fpc config are contained in a specific >folder, Lazarus launch icons on the screen are named from the folder you >decided to use for that version, and you can have as many as you have >space on your disk. Currently I have 7 different Lazarus/fpc sets to >select from, from a Lazarus 1.6 to a Lazarus 2.2.6, plus a couple of >Lazarus Trunk (one using trunk fpc, the other using stable fpc). Give it >a try. It will not disturb anything of your current installations. >It takes a minimum to understand how it works, but then it's a paradise. > >Giuliano > Thanks for your input! On Windows I have been using the installer for Lazarus which can be downloaded from SourceForge and this isolates the Lazarus and Fpc into its own "sandbox" such that these probnlems do not appear. My real problems are occurring on Linux... Since there is no good installers to find I have created my own shellscript to install from sources (Lazarus and Fpc separately). And on Linux I do not want anything done as root and installed outside of $HOME so my script makes sure everything is located within $HOME. But there I have the interference problem between the Fpc versions... Regarding fpcupdeluxe, I have now tried it on Windows and after a bit of trial-and-error I have got the knack of how it works for a couple of Lazarus installs of different versions etc. Seems that the result is kept inside an isolated sandbox more or less like the SF install exe does for Lazarus and Fpc. But the advantage here is that with fpcupdeluxe one can modify the installation after it has been installed, which is very good. I do not yet understand how to get cross-compile installed properly though... (I would like to be able to build for RaspberryPi4 (and 3) on my Windows PC if possible. RPi uses ARM cpu of course... Anyway, a question for you: Is it possible to use fpcupdeluxe on the following Linux platforms and if so how is it done there? - Ubuntu 20.04.6 LTS (using AMD CPU) - Ubuntu 22.04.2 LTS (using AMD CPU) - RaspberryPi4 with Raspbian Buster and Bullseye (ARM CPU) I can attach to these RPi devices using VNC and PuTTY And thanks for bringing up fpcupdeluxe, I had a look 3-4 years back and did not then really get the advantage. Finally: fpcupdeluxe shows as candidates for install Lazarus 2.3.0 and Fpc 3.2.4 both of which releases seem not to exist yet... What is the deal here? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] version `GLIBC_2.34' not found error when running app on different PC
On Fri, 17 Mar 2023 14:28:28 +0100 (CET), Michael Van Canneyt via lazarus wrote: >> Since I am only using FPC units, how can I know??? > >You want to say that you don't even know what the units do that you are using ? > >You have no idea how scary that is to me... > No, I wanted to say how could I know which *units use* the c library that triggers the failure in order to do what they are doing, which I am fairly certain I do know... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] version `GLIBC_2.34' not found error when running app on different PC
On Fri, 17 Mar 2023 14:17:11 +0100, Sven Barth via lazarus wrote: >Bo Berglund via lazarus schrieb am Fr., 17. >März 2023, 13:54: >> This aplication is a console (i.e NO GUI) application and it only uses >> these >> units: >> >> videosplitcmb.lpr: >> >> uses >> {$IFDEF UNIX} >> cthreads, >> {$ENDIF} >> Classes, >> { you can add units after this } >> >> and >> >> utils.pas: >> >> uses >> Classes, >> SysUtils, >> Process; >> >> What is complex here? >> > >Your code uses threads and on *nix systems that requires the C library. Ok, my code does in fact NOT use threads but that is a standard uses clause that gets inserted in all new projects created in Lazarus... Anyway, on the Ubuntu 22.04 machine I now commented out cthreads and rebuilt the application, then copied the binary over to the Ubuntu 20.04 system where it previously did not run. Result: It does no longer throw this error! Thanks a lot for the suggestion! >Regards, >Sven -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] version `GLIBC_2.34' not found error when running app on different PC
On Fri, 17 Mar 2023 08:43:55 +0100 (CET), Michael Van Canneyt via lazarus wrote: >FPC has not changed. It still works the same. >Everything that is under control of FPC is linked statically. > >But a complex GUI system like the LCL uses GTK/GDK/Qt and other libraries, >and those are dynamic, external libraries over which FPC or lazarus has no >control. This aplication is a console (i.e NO GUI) application and it only uses these units: videosplitcmb.lpr: uses {$IFDEF UNIX} cthreads, {$ENDIF} Classes, { you can add units after this } sysutils, utils, runthread; and utils.pas: uses Classes, SysUtils, Process; What is complex here? >If you use a unit that relies on LibC somewhere, you automatically depend on >the libc >version. Since I am only using FPC units, how can I know??? >> Developing on an up-to-date system should ensure the output could work >> everywhere, but not so now it appears > >No-one can ensure this. It was never so. It used to be worse in the past. > >Distributions change, and sometimes break binary compatibility. >This means you must cater for that. > >There are roughly 2 ways: >- Compile on a system that has the correct version of libraries as on the > target computer. I checked out the project into another Ubuntu 20.04 device with Lazarus/FPC available. Project compiled just fine and this binary runs on 20.04 and 22.04... >> Notice: This is a command line utility so it needs no access to any GUI >> components at all... > >You use libc through some unit that is included in your sources. The libc >library on both systems you tested on differ too much, that is why you have >the error. Well, since I have *not* added any units except what is supplied by FPC/Lazarus I don't understand what this means for a simple command line utility which uses TProcess to start instances of ffmpeg -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] version `GLIBC_2.34' not found error when running app on different PC
On Fri, 17 Mar 2023 08:53:01 +0300, Mehmet Erol Sanliturk via lazarus wrote: >Some portability is obtained if the libraries are linked as "static" . >If "dynamic" linking is selected , during execution of the program , >the "same" library should be in the executing computer . > How is this accomplished in Lazarus? Does this change happen randomly or is it connected to the major Ubuntu releases like going from 20.04 to 22.04 rather than just keeping 20.04 up-to-date? It implies having to build applications on as old a system as ever possible, maybe using 16.04 or earlier just for making apps that can run on all systems, is that really true? It makes no sense to me... And from https://wiki.freepascal.org/Lazarus/FPC_Libraries -- Static linking FPC compiles and links a static executable by default. That means it tells the linker to put all .o files of the project and all packages into one big executable. Advantages: No external dependencies. Disadvantages: No code is shared between different programs on the same computer. You can not load/unload a plugin. --- This idea was always why I liked Delphi when it came along in 1995 or so, just build an executable and it could be run everywhere. This is also why I liked FreePascal when it appeared because I did not need to bother with distributing extra files all over the place. So why has it changed now and how can I get around it? Developing on an up-to-date system should ensure the output could work everywhere, but not so now it appears I cannot find any setting for this in Lazarus. Notice: This is a command line utility so it needs no access to any GUI components at all... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] version `GLIBC_2.34' not found error when running app on different PC
I have used Lazarus 2.2.6 with fpc 3.2.2 on an Ubuntu 22.04 PC (recently dist-upgraded from 20.04) to modify a video handling command line utility I started back in 2018. It uses calls to ffmpeg to do the actual video stuff and it was originally built using earlier versions of Lazarus (2.0.12) and FPC (3.0.4), but now I fixed a few issues using an updated installation with the latest versions. The program I have built runs fine on that PC (an HP Elitebook w8440) but when I move the executable from this machine to my Ubuntu 20.04 server PC I get this when I try to run it: videosplitcmb: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by videosplitcmb) So it seems like somehow the program uses some underlying function in the Linux system which I have no control over... What can I do in order to make the executable portable to other linux machines with the same CPU architecture??? I do not know what the library libc.so.6 even does -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus Release 2.2.6
On Thu, 16 Mar 2023 20:00:02 +0100, Martin Frb via lazarus wrote: >On 16/03/2023 18:46, Bo Berglund via lazarus wrote: >> >> But it also seems like on each system there is only one version of fpc that >> can >> be "active" (at least on Linux) because its config is stored outside of the >> pcp >> dir in a user global fashion. >> How can I make the fpc compiler versions co-exist and be recognized by the >> respecive versions of Lazarus? >> > >As for Lazarus: >Lazarus takes an argument --pcp= >So each version can be pointed to its own config. I start Lazarus from desktop files in ~/.local/share/applications. THe Lazarus_2.2.6.desktop file looks like this (long lines wrapped): [Desktop Entry] Comment=Lazarus IDE 2.2.6 Terminal=false Name=Lazarus 2.2.6 #Entry below in order to set up PATH correctly on start Exec=/bin/bash -l -c '/home/bosse/dev/lazarus/2.2.6/startlazarus --pcp=/home/bosse/.lazarus_2.2.6' Type=Application Icon=/home/bosse/dev/lazarus/2.2.6/images/ide_icon48x48.png Categories=Application;IDE;Development;GTK;GUIDesigner;Programming; NoDisplay=false Keywords=editor;Pascal;IDE;FreePascal;fpc;Design;Designer; >That option can be put into a file called lazarus.cfg which is to reside >in the directory of your lazarus exe file Never heard about this before... >(or the startlazarus file if you use that / you only need that if you >have non-writable root installs, and/or for restarting after build) >Mind that if you have root installs, then the lazarus exe eventually >ends up in the pcp, and the lazarus.cfg must be with the startlazarus >that would start the lazarus. As I tried to explain my installs are all located inside $HOME, I do not like having global installs of tools that are built from sources like I do. > >As for FPC: >Either use scripts to start lazarus and set the $PATH for each fpc. What do you mean by "set the $PATH"? I have tried pointing the compiler setting in the dialog that pops up on first start to the actual correct version of ppcx64, but the setting is not accepted... So I have symlinked it into $HOME/bin/ instead. But this is a single compiler then and will be the one for all Lazarus versions... >Or start the ppc directly // configure lazarus to use the ppc. As I said above Lazarus is started from a desktop file where the ppc dir is defined... > >Mind that you also need the fpc.cfg to be found (so that can have ifdefs >based on the version) This is a big problem since the fpc.cfg seems to be located in a common location too. I will have to study the info below and see how it can be applied to my case... > >--- > From my setup script > >this sets a folder for each fpc, and creates some symlinks >- The IDE must be pointed to use the ppc in the lib/fpc/3.2.2/ folder. >- there must be no global fpc.cfg (/etc or /home/name/.fpc or the like) > >compiling with -va allows to check what is used. > >$INSTPATH can be whatever. > >- > >mkdir -p /home/m/fpc/$INSTPATH/ >mkdir -p /home/m/fpc/$INSTPATH/gl >mkdir -p /home/m/fpc/$INSTPATH/gw >mkdir -p /home/m/fpc/$INSTPATH/def >mkdir -p /home/m/fpc/$INSTPATH/o4 > > >cd /home/m/fpc/$INSTSRC/source > >make clean >make all OPT="-gw -O-1 " >make install INSTALL_PREFIX=/home/m/fpc/$INSTPATH/gw > >mkdir -p /home/m/fpc/$INSTPATH/gw/lib/fpc/etc >mkdir -p /home/m/fpc/$INSTPATH/gw/etc > >cd /home/m/fpc/$INSTPATH >gw/bin/fpcmkcfg -d basepath=/home/m/fpc/$INSTPATH/gw/lib/fpc/$INSTVERS > >gw/lib/fpc/etc/fpc.cfg >gw/bin/fpcmkcfg -d basepath=/home/m/fpc/$INSTPATH/gw/lib/fpc/$INSTVERS > >gw/etc/fpc.cfg > >ln -s /home/m/fpc/$INSTPATH/gw/lib/fpc/$INSTVERS/ppcx64 >/home/m/fpc/$INSTPATH/gw/bin/ppcx64 -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus Release 2.2.6
On Thu, 16 Mar 2023 09:05:06 +0100, Martin Frb via lazarus wrote: >On 16/03/2023 07:53, Bo Berglund via lazarus wrote: >> The install seems to have worked, but seeing this release comment I >> now have to >> ask if 3.2.2 is a *requirement* for proper operation or if it just happens >> to be >> what you used when building? >> >> Do I have to change my fpc installed version and rebuild Lazarus to have it >> work >> properly? > >No, its not. Currently 3.2.0 is the minimum supported. (All else before >is your own good luck, or the absence thereof). > >We usually support: >- the current fcp release (at the moment 3.2.2) >- the previous release (3.2.0) >- fixes branch and main branch / for both support may lack a few days, >if there are breaking changes. > >Though, we do more/most testing with the current release. Issues that >are 3.2.0 only usually only get attention when reported. >On the other hand, issues that are only 3.2.0 are usually "doesn't >compile at all" (and IIRC we have a CI task for that now). OK, then my next question is: I have a number of Lazarus releases installed where 3.0.4 is the fpc used. So they all used the same and there was no problem. (This is on Ubuntu Linux 22.04 btw and I install everything from sources) But if I now install fpc 3.2.2 as well I will have 3 different versions of the compiler and the Lazarus-es are set up to use different versions (3.0.4 and 3.2.0 respectively). It seems like Lazarus on first start needs to determine the location etc of fpc and it saves it inside the pcp dir of the respective version. But it also seems like on each system there is only one version of fpc that can be "active" (at least on Linux) because its config is stored outside of the pcp dir in a user global fashion. How can I make the fpc compiler versions co-exist and be recognized by the respecive versions of Lazarus? And how can I change the newly installed Lazarus version 2.2.6 to use fpc 3.2.2 (when it is installed) rather than the 3.2.0 that it found during first start? That screen is never again displayed -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus Release 2.2.6
On Thu, 9 Mar 2023 10:31:17 +0100, Mattias Gaertner via lazarus wrote: >The Lazarus team is glad to announce the release of Lazarus 2.2.6. > >This is a bugfix release and was built with FPC 3.2.2. > I did not know of this when I yesterday went to install the latest Lazarus release from sources on my Ubuntu 22.04.2 LTS system. I retrieved the sources as a tarball from GitLab. My system has a number of differet versions of Lazarus installed but FPC is 3.2.0 (not 3.2.2)... The install seems to have worked, but seeing this release comment I now have to ask if 3.2.2 is a *requirement* for proper operation or if it just happens to be what you used when building? Do I have to change my fpc installed version and rebuild Lazarus to have it work properly? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Screwed up Lazarus installation - how to make clean and start over?
On Wed, 22 Feb 2023 22:59:15 +0100, Werner Pamler via lazarus wrote: >You uninstall a package in the "Package" > "Install/Uninstall packages" >dialog. Select the package to be removed in the left list, click >"Uninstall selection" and then "Save and Rebuild IDE". I did the "Uninstall selection" OK but then I decided to go look for something else so I did not use the rebuild button. Next I went there again to do the rebuild, but now the button is no longer enabled :-( But I found another in Tools/Build Lazarus with profile Normal IDE If I use that will it do the same as the button you referred to? >This will remove bglcontrols which is a runtime/designtime package, but >it will not remove bgrabitmappack - it is a runtime package and thus is >not compiled into the IDE. This cannot crash the compilation of the IDE. >If you also want to get rid of it, go to "Package" > "Package Links", >find it in the list, check it and click "Delete selected". This removes >the path to the package from an internal list so that the IDE no longer >knows where the package is (the files are still there, though - but you >can delete them manually in the OS). I will remove the package folders below pcp dir onlinepackagemanager for these packages. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Screwed up Lazarus installation - how to make clean and start over?
On Wed, 22 Feb 2023 18:05:25 +0100, Ondrej Pokorny via lazarus wrote: >On 22.02.2023 18:01, Bo Berglund via lazarus wrote: >> So now I have found a package in OnLinePackageManager that will hose Lazarus >> if >> installed: >> BGRABitmap >> >> Up until installing that I was fine, but now Lazarus won't start >> >> The Initial image is shown for 3 seconds and then disappears. >> Then nothing... >> >> What can I do to get into Lazarus and remove the BGRABitmap? >> >> Or is there somewhere a file or such I can edit and then rebuild the IDE from >> the command line? >> >> This is on Linux (Raspberry Pi OS). > >Usually there is an "old" Lazarus executable (lazarus.old) next to the >Lazarus executable. I usually switch to that if something is wrong with >the new one. A problem arises if the old exe doesn't work either because >it has been overwritten etc. Try it, that might be the quickest help. > Thanks Ondrej! I had no idea such a 1-level backup existed! Now running that older version but with a partially installed package... bglcontrols.lpk is not installed but bgrabitmappack.lpk is. So the whole thing is partially installed. How can I *remove it totally* such that it is not existing at all in my system? I don't want this component to reinstall when I add another package and rebuild Lazarus. Note: I did the same OLPM install on a Linux Mint (PC platform) and there the whole package was installed just fine. No crash on that CPU. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Screwed up Lazarus installation - how to make clean and start over?
On Wed, 22 Feb 2023 10:43:35 +0100, Bo Berglund via lazarus wrote: >Lacking any advice here I started over by removing the old Lazarus directory >and >the pcp dir and then build from start with a new set of source files in a fresh >2.2.4 subdir... > >All was Ok until again the OLPM packages were installed when the new Lazarus >also failed to start. It seems like at least one of the packages I use from >OLPM >will hose Lazarus! > >So now I will repeat the effort but this time I will install one package after >another using OLPM and rebuild Lazarus IDE after each. This way I would be able >to pinpoint the one that causes the problem. So now I have found a package in OnLinePackageManager that will hose Lazarus if installed: BGRABitmap Up until installing that I was fine, but now Lazarus won't start The Initial image is shown for 3 seconds and then disappears. Then nothing... What can I do to get into Lazarus and remove the BGRABitmap? Or is there somewhere a file or such I can edit and then rebuild the IDE from the command line? This is on Linux (Raspberry Pi OS). -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Screwed up Lazarus installation - how to make clean and start over?
On Tue, 21 Feb 2023 19:18:28 +0100, Bo Berglund via lazarus wrote: >I was trying to nail down the reason for the fppkg errors on start of Lazarus >2.2.4. >I had the install running fine except for the Config screen showing up on every >start of Lazarus with an error message about fppkg... > >So I proceeded to install my usual set of packages from OLPM, but when I had >selected the set I usually install and it was done and asked about rebuilding >Lazarus it did so and at the end closed itself and did not re-appear! >Now I cannot start Lazarus at all > >I tried to move the pcp dir away but it did not work either and starting with >an >empty pcp dir does also not work. > >So I tried to start over by going to the Lazarus dir and issue make clean, but >that did also not work: > >~/dev/lazarus/2.2.4 $ make clean >Makefile:234: *** The Makefile doesn't support target can't-executed,, please >run fpcmake first. Stop. > >What would be the correct procedure now to start over? Lacking any advice here I started over by removing the old Lazarus directory and the pcp dir and then build from start with a new set of source files in a fresh 2.2.4 subdir... All was Ok until again the OLPM packages were installed when the new Lazarus also failed to start. It seems like at least one of the packages I use from OLPM will hose Lazarus! So now I will repeat the effort but this time I will install one package after another using OLPM and rebuild Lazarus IDE after each. This way I would be able to pinpoint the one that causes the problem. Finally: I have looked at https://wiki.freepascal.org/lazbuild and want to know: Is there a way to specify the compiler *path* to use for lazbuild? For example (on one line): lazbuild --build-ide= --pcp=$HOME/.lazarus_2.2.4 --compiler=$HOME/lib/fpc/3.2.2/ppcarm According to the wiki it is unclear to me if a path can be used rather than only the file name (in which case it needs to be on path?)... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Lazarus and FreePascal version relations on Linux and Windows?
I have used Lazarus on Windows and Linux many years and I have built the Linux versions from sources but used the official installer for Windows. On Linux I have had parallel versions of Lazarus but usually the same FPC and this has worked fine. I think that on Linux the FPC becomes a global version and then new Lazarus gets confused... On Windows the installer separates the complete package into a separate directory which contains both Lazarus and FPC and none is put on system path. So when I have say 6 different versions of Lazarus on Windows they are all separate and do not conflict with each other. Now I am having problems installing Lazarus 2.2.4 on Linux systems where older Lazarus version exist because they use an older FPC which the new Lazarus cannot use (3.0.4 vs 3.2.2). On Linux FPC is put on path and so the instant one installs 3.2.2 on a system already using 3.0.4 disaster follows... Is this the reason for the continued problems with fppkg? And another question: How can I force Lazarus to show the initial configuration page, which is shown on the very first start after installing Lazarus and later is skipped? I think I remember that there is a way to show it from within Lazarus but I cannot find where now... Either way I would like to look at the config page for a working system so I can see the differences between that and a Lazarus that behaves bad. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Screwed up Lazarus installation - how to make clean and start over?
I was trying to nail down the reason for the fppkg errors on start of Lazarus 2.2.4. I had the install running fine except for the Config screen showing up on every start of Lazarus with an error message about fppkg... So I proceeded to install my usual set of packages from OLPM, but when I had selected the set I usually install and it was done and asked about rebuilding Lazarus it did so and at the end closed itself and did not re-appear! Now I cannot start Lazarus at all I tried to move the pcp dir away but it did not work either and starting with an empty pcp dir does also not work. So I tried to start over by going to the Lazarus dir and issue make clean, but that did also not work: ~/dev/lazarus/2.2.4 $ make clean Makefile:234: *** The Makefile doesn't support target can't-executed,, please run fpcmake first. Stop. What would be the correct procedure now to start over? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Fppkg reports RTL not installed - Lazarus 2.2.4/fpc 3.2.2 from sources on Ubuntu
On Tue, 21 Feb 2023 11:46:57 +0100, Luca Olivetti via lazarus wrote: >El 21/2/23 a les 11:12, Bo Berglund via lazarus ha escrit: > >> So it is definitely about the Lazarus version 2.2.4! > > >I know that this won't help you, but just for the record I have Lazarus >2.2.4 both under windows and linux and no popup on either. >Both self compiled with fpc 3.2.2 (32 bits fpc from installer under >windows, 64 bits fpc self compiled under linux). > Now I have installed Lazarus 2.2.4 with fpc 3.2.2 on an RPi4B where I already had Lazarus 2.0.8 and fpc 3.0.4. The result is *exactly the same* as what I have described above: when I first start Lazarus 3.2.2 the customize dialog pops up where I have to configure various parts of the system: Lazarus: /home/pi/dev/lazarus/2.2.4/ Fpc: /home/pi/lib/fpc/3.2.2/ppcarm Fpc sources: /home/pi/dev/fpc/3.2.2 Make: /usr/bin/make Debugger: /usr/bin/gdb Fppkg: /home/pi/.config/fppkg.cfg (from the dropdown selector) The bottom pane shows this message: File: /home/pi/.config/fppkg.cfg Error: there is a problem with the Fppkg configuration. (Fppkg reports that the RTL is not installed.) You could try to restore the configuration files automatically, or adapt the configuration file manually. At this point I can start the IDE and it looks pretty much normal. Close Lazarus and open it again and I am back at the Config dialog with a stated error about the Fppkg item. My procedure for installing is this: 1. Build freepascal: Install various dependencies first: sudo apt install -y libx11-dev libgdk-pixbuf2.0-dev libcairo2-dev gir1.2-coglpango-1.0 libpangox-1.0-dev xorg-dev libgtk2.0-dev libpango1.0-dev sudo apt install -y freetds-dev gdb copy ppcarm version 3.2.0 from another RPi to $HOME/dev/fpc Then: cd $HOME/dev/fpc wget https://gitlab.com/freepascal.org/fpc/source/-/archive/release_3_2_2/source-release_3_2_2.tar.gz tar -xvf source-release_3_2_2.tar.gz mv source-release_3_2_2 3.2.2 cd 3.2.2 make clean FPC="$HOME/dev/fpc/ppcarm" make all FPC="$HOME/dev/fpc/ppcarm" make install PREFIX="$HOME" FPC="$HOME/dev/fpc/3.2.2/compiler/ppcarm" rm "$HOME/bin/ppcarm" ln -sf "$HOME/lib/fpc/3.2.2/ppcarm" "$HOME/bin/ppcarm" make sourceinstall PREFIX="$HOME" FPC="$HOME/bin/ppcarm" $HOME/lib/fpc/3.2.2/samplecfg $HOME/lib/fpc/3.2.2 $HOME mv "$HOME/fpc.cfg" "$HOME/.fpc.cfg" 2. Build Lazarus cd $HOME/dev/lazarus wget https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/lazarus_2_2_4/lazarus-lazarus_2_2_4.tar.gz tar xvf lazarus-lazarus_2_2_4.tar.gz mv lazarus-lazarus_2_2_4 2.2.4 cd 2.2.4 make clean time make bigide strip -s lazarus mkdir -p $HOME/.lazarus_2.2.4 3. Create desktop file to launch Lazarus: - nano $HOME/.local/share/applications/lazarus_2.2.4.desktop Add this to the file: [Desktop Entry] Comment=Lazarus IDE 2.2.4 Terminal=false Name=Lazarus 2.2.4 Exec=/home/pi/dev/lazarus/2.2.4/startlazarus --pcp=/home/pi/.lazarus_2.2.4 %f Type=Application Icon=/home/pi/dev/lazarus/2.2.4/images/ide_icon48x48.png Categories=Application;IDE;Development;GTK;GUIDesigner;Programming; NoDisplay=false Keywords=editor;Pascal;IDE;FreePascal;fpc;Design;Designer; At this point the start menu "Programming" submenu contains the "Lazarus 2.2.4" item and Lazarus can be launched. Any ideas what has gone wrong? And please note that unlike on Linux (source install as above) I have installed Lazarus 2.2.4 on Windows using the official installer from SourceForge and the exact same thing happens... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Fppkg reports RTL not installed - Lazarus 2.2.4/fpc 3.2.2 from sources on Ubuntu
On Thu, 9 Feb 2023 22:37:20 +0100, Martin Frb via lazarus wrote: >On 09/02/2023 21:57, Bo Berglund via lazarus wrote: >> And it seems to be looking for $HOME/.config/fppkg.cfg even though I >> am using >> separate install dirs for Lazarus 2.0.12 and 2.2.4 and the launch file >> lazarus_2.2.4.desktop contains --pcp=/home/bosse/.lazarus_2.2.4 >> >> So I would expect the location of the fppkg.cnf file to be inside that pcp >> dir, >> but it is not. > >According to what I gathered info wise, fppkg only supports one config >dir. (it has some options, but not sure the IDE uses those) >So it does not work well for Lazarus multi install. This is just terrible! >From now on one has to view the error dialog every time one starts Lazarus? And nothing can be done about it? As I said I have used many Linux and Windows systems all with multiple installs of different versions of Lazarus and FPC and it has all worked well regarding launching the IDE. Never anything like this happened before. And the problem is not even on a single new install but on every install I do both using the Wiondows installer and building from sources. >The IDE will work fine without it. >It' only needed if you need some of the few packages that are only avail >via fppkg (though you can download them by hand anyway) I have never been aware of this before and it has just worked. I am not doing any fancy installs just first the basic installation and then use OLPM to install all of the extra packages I need (same list every time). Finally putting my own developed packages and utilities on each system as well. I have never even been aware of the fppkg program or its use. And with a new release I usually just make a parallel installation using pcp functionality. >>> Try to delete the old config by hand. >>> Then -outside the IDE - use the latest (3.2.2) fppkg to create a new >>> config. (may or may not need the fpc install in PATH) >> Exactly what do you suggest here? >> - Which old config? File name and location please. >The one in your home folder (I don't have Linux path)... >On Windows it's in %APPDATA%\Local\FreePascal\fppkg > >There are files like fppkg.cfg mirrors.xml packages.xml and some folders. > No other file found there than fppkg.cfg and if I reneme it and start fppkg.exe manually it recreates the exact same content in a new fppkg.cfg file. Still no effect on the actions on startup, error dislog pops up. >> - How do I use the new fpc to recreate it? I don't even know what it is >there is an fppkg utility in the fpc folder. (fppkg is part of fpc) On Linux it is found here: /home/bosse/bin/fppkg Notice that this is a global location for my user. And on my Windows install here: C:\Programs\Lazarus_2.2.4\fpc\3.2.2\bin\x86_64-win64\fppkg.exe This is a Lazarus unique location for ver 2.2.4 and on Windows it is not on path... Still both installations behave the same. > >If you just run it >fppkg >it should create a config file (if none exists). Yes it creates a new cnf file identical to the old renamed file. But still my new Lazarus won't start cleanly, whereas 2.0.12 starts just fine on Winddows as well as on Linux. No popup error message anywhere to be seen... >It is not about the lazarus version, but different fpc versions. >In my case (but maybe I was lucky) the older fpc didn't complain > I have used Lazarus since a long time, on my Windows 10 PC I have versions: 2.0.6, 2.0.8, 2.0.10, 2.0.12 and 2.2.4 All of these have their own fpc compiler installed with them in their own directory trees and it has worked just fine up until this newest version 2.2.4 broke it. And it does the same on both Linux and Windows!!! So it is definitely about the Lazarus version 2.2.4! I might try and put it on a Raspberry Pi4 just to check this... One that I have access to has 7 different Lazarus versions with the latest being 2.0.12 and FPC versions are 3.0.4 and 3.2.0 and it uses the pcp dir functionality to allow the multiple installs of different Lazarus versions. I will do this when I get the time later... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Using packages for often used units across projects?
On Sun, 12 Feb 2023 15:35:27 +0100, Luca Olivetti via lazarus wrote: > >https://wiki.lazarus.freepascal.org/Lazarus_Packages#Creating_a_package_for_your_common_units > > Follow-up question: --- Suppose I make a package with about 10 non-GUI utility units and use the Package Manager to compile them so they will be known to new projects if I add a dependency to this package. Then in a new project I put a single one of the units into my uses clause, will then the compile include just that unit or will it grab all of the package content into the resulting binary? I hope that it will just compile the specified unit into the program and not the complete package, but want to check this in case I am not understanding how it works -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Using packages for often used units across projects?
On Sun, 12 Feb 2023 15:35:27 +0100, Luca Olivetti via lazarus wrote: >El 12/2/23 a les 14:44, Bo Berglund via lazarus ha escrit: > >> I found the wiki page: >> https://wiki.lazarus.freepascal.org/Lazarus_Packages >> >> it seems not to describe my use case, I believe. > >Actually it does, if you follow the heading "5.4 Creating a package for >your common units" right at the beginning of the page > >https://wiki.lazarus.freepascal.org/Lazarus_Packages#Creating_a_package_for_your_common_units > > >Bye Thanks Luca! This is what I was looking for. :) -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Using packages for often used units across projects?
I am working on porting a set of applications (company internal tools and utilities mostly) from Delphi to FPC/Lazarus and now I have encountered use of a number of same units in several different applications. It seems not so good to copy the files into each project. In Delphi they were accessed from one location by several projects by using search path settings (not available in Lazarus). So now I wonder if one can put several really non-related units in a common package such that they will be available in every application from Lazarus? I.e. package lazcommon containing 5+ different units defining various classes and compiled by the package handler. So I am not talking about a package implementing a common typoe of actions like Internet communications or some graphics hanling or such, just a container that would simplify using commonly used units like for serial comm, application logging, special graphics etc These files would not have a GUI impact at all, never placed on a form and not configured in the GUI... So this package would not be installed, just compiled in the package manager. If this is how it can be done, is there some tutorial (for dummies) that handles the way it is done? I found the wiki page: https://wiki.lazarus.freepascal.org/Lazarus_Packages it seems not to describe my use case, I believe. But it is too dense for me to really understand it all... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] How to make TBitButton set the ModalResult properly and close the form?
On Sat, 11 Feb 2023 21:15:25 +0100, Bo Berglund via lazarus wrote: >So in order to fix this on the first form I have had to implement the OnClick >event and code the following into them: > >ModalResult := mrOk >(or mrCancel) as needed. > >This causes the wanted behaviour. > >But this was not how the Delphi TBitButton operated, why has it changed? >And is there some way I can restore this functionality without having to add >OnClick event handlers to all of these buttons? >Some special $MODE setting perhaps? > >The Delphi converter I used in Lazarus to port the application put >{$MODE Delphi} >into most units.. It might be the converter that does this... It made a new lfm file from the dfm that Delphi had made and maybe it did not transfer the button kind properly so that the modalresult was not set as it would be when the kind was selected... Anyway by going over the forms and changing ModalResult to the proper value depending on the Kind property value made it work as expected. No OnClick event handler needed. Now working properly. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] How to make TBitButton set the ModalResult properly and close the form?
I am porting a Windows application from Delphi2007 to Lazarus/Fpc and have run into problems with the dialog forms used in the app. They are all provided with two TBitButton buttons, one for OK and the other for Cancel. But unlike how it works on Delphi when I use any of these when running the ported app nothing at all happens! Luckily I have kept the close button on the form border so it can be closed that way. But then I cannot get any confirmation back to the main application... So in order to fix this on the first form I have had to implement the OnClick event and code the following into them: ModalResult := mrOk (or mrCancel) as needed. This causes the wanted behaviour. But this was not how the Delphi TBitButton operated, why has it changed? And is there some way I can restore this functionality without having to add OnClick event handlers to all of these buttons? Some special $MODE setting perhaps? The Delphi converter I used in Lazarus to port the application put {$MODE Delphi} into most units.. I have a queue of utilities I need to port so it would be good not having to deal with all of these dialogs... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Porting Delphi (2007/XE5) application, how to handle ADODB?
On Sat, 11 Feb 2023 16:31:56 +0100, Martin Frb via lazarus wrote: >On 11/02/2023 12:23, Bo Berglund via lazarus wrote: >> >> >> Then rebuilt and tried to run, but I get an immediate fatal exception! >> This happens both when starting within Lazarus and from the exe file itself. >> Message: >> >> | Project AppManager raised exception class 'External: | >> | ACCESS VIOLATION' with message: | >> | Access violation reading from address| >> | $0040| >> | | >> | At adress 196AD [OK]| >> >> >> How can I find the cause of this exception? >> > >Did the debugger jump to any source code? >What does the "Callstack" window show? > >If neither shows anything, the error might be in the RTL or kernel. What >does the assembler win show? > >Give the data from the error message, I guess there is a nil pointer >deref (e.g. access to a field in an object that is nil) When I wrote my last post I had problems finding a location to put a breakpoint so I could step through the code. But later I found by trial-and-error where the exception was coming from in general. And where I could put a breakpoint to start stepping from. It is from a logging component I have used on Delphi since more than 20 years. When it starts its logging it is supposed to read the application version info and write a start entry to today's log including the application version etc. When I moved some applications from Delohi on Windows to Lazarus on Linux I had to make a clone of the logging component where a lot of dependencies on external components for reading version etc was removed and instead the Lazarus/fpc handling was taken into account. Then it has worked fine on Lazarus at least on Linux. When porting the current application I changed the Class name for the logging component correspondingly and hoped it would be enough, but unfortunately it is not. I don't know where I should fix it yet and I don't have time to do it now when I am busy just porting the handler application. So for now I commented out all calls to the logger creation (where the exception happened) and its use so I can move on. Success! This has brought me to the verification that now the ported app is actually working regarding access to the MSSQL database! :-) The DB conmnection is needed in order to start up the app at all, without a database verified login it just shuts down. But it IS working with the MSSQLSERVER just fine so far. But I have another problem I will describe in a new thread... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Porting Delphi (2007/XE5) application, how to handle ADODB?
On Sat, 11 Feb 2023 11:58:04 +0100, Bo Berglund via lazarus wrote: >Now I have gotten the project to build so I should start debugging. > >But when I try to run it from within Lazarus (hit the green arrow button) then >a >pop-up image appears: > >-- >Enable Dwarf 2 (-gw)? >The project does not write debug info in Dwarf format. The "FpDebug internal >Dwarf-debugger" supports only Dwarf. >[Enable Dwarf2 with sets] [Enable Dwarf2 (-gw)] [Enable Dwarf3 (-gw3) [Cancel] >-- > >What am I supposed to do with this? After reading up on the Wiki: https://wiki.freepascal.org/DWARF I selected Dwarf2 with sets. Then rebuilt and tried to run, but I get an immediate fatal exception! This happens both when starting within Lazarus and from the exe file itself. Message: | Project AppManager raised exception class 'External: | | ACCESS VIOLATION' with message: | | Access violation reading from address| | $0040| | | | At adress 196AD [OK]| How can I find the cause of this exception? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Porting Delphi (2007/XE5) application, how to handle ADODB?
On Fri, 10 Feb 2023 14:00:32 +0100 (CET), Michael Van Canneyt via lazarus wrote: > > >On Fri, 10 Feb 2023, Bo Berglund via lazarus wrote: > >> On Mon, 23 Jan 2023 09:59:14 +0100 (CET), Michael Van Canneyt via lazarus >> wrote: >> >>> >>> >>> On Mon, 23 Jan 2023, Bo Berglund via lazarus wrote: >>> >>>> I have a number of "older" applications developed on Windows using >>>> Delphi7-2007-XE5, which use ADODB for database accesses. >>>> The database is Microsoft SQLSERVER. >>>> >>>> Now I no longer have the old Borland software installed (issues with >>>> Windows 10 >>>> etc) so I want to port the projects to FPC/Lazarus. >>>> I have ported some other non-database applications which (with some effort) >>>> seems to have worked out OK. >>>> >>>> Now I am facing the challenge of doing it on an adodb database enabled >>>> application and I would like to know if there is some "compatible" way of >>>> doing >>>> it, which is described somewhere? >>> >>> Yes. >>> >>> You need to use SQLDB, and the TMSSQLConnection. >>> >>> See https://wiki.freepascal.org/SQLdb_Tutorial1 for a simple explanation. >>> >>> The page https://wiki.freepascal.org/SQLdb_Package also contains some >>> explanations >>> for setup. >>> >>> There are some other pages in the wiki. >>> >>> A more in-depth explanation is in the lazarus book. >>> >>> Or you can look at >>> >>> https://www.freepascal.org/~michael/articles/ >>> >>> several articles discuss SQLDB, in particular: >>> >>> https://www.freepascal.org/~michael/articles/lazviddb/lazviddb.pdf >>> >>> That should be enough to get you started. >>> >>> Michael. >> >> Thanks! >> >> Almost there but not quite... >> I am using Lazarus 2.2.4 with fpc 3.2.2 on a Windows 10 box. >> >> The application seems to have been converted pretty well using the Lazarus >> Delphi Conversion function to migrate from Delphi with some extra defines >> needing adjustments. But these have been minor considering the size of the >> application. >> >> But the ADODB conversion is now halted on the TSqlQuery and TMSSQLConnection >> items which operate so differently from ADODB... >> >> I added this in uses: >> >> mssqlconn, //Had to add this in order to use TMSSQLConnection >> sqldb, >> >> This made the code pass the defines of the objects: >> >> TAppDbHandler = class >> private >>FConn: TMSSQLConnection; // TADOConnection; >>FQuery: TSQLQuery;// TADOQuery; >>FDatabaseServer, >>FDatabase, >>FConnString, >>FDbUser, >>FDbPassword, >>FUserName, >>FUserPassword: string; >> >> >> But next I get a lot of errors because of the differences between this and >> the >> Delphi ADODB we used before. >> >> I got lost here... >> >> constructor TAppDbHandler.Create; >> begin >> FConn := TMSSQLConnection.Create(NIL); //was: TADOConnection.Create(NIL); >> FQuery := TSQLQuery.Create(NIL); //was: TADOQuery.Create(NIL); >> FQuery.Connection := FConn; //<== Triggers an error > >FQuery.Database:=FConn; > >> FDatabaseServer := >> ReadRegString(HKEY_CURRENT_USER,'Software\...\AppManager','DatabaseServer','servername'); >> FDatabase := >> ReadRegString(HKEY_CURRENT_USER,'Software\...\AppManager','Database','APPMANAGER'); >> FConnString := 'Provider=SQLOLEDB.1;Persist Security Info=False;' + >> 'Network Library=DBMSSOCN;Data Source=' + FDatabaseServer + >> ';' >> + >> 'Initial Catalog=' + FDatabase; >> FDbUser := ''; >> FDbPassword := ''; >> end; >> >> >> Is there some example which does not use component drag-drop and properties >> settings in the GUI but does all of it in code towards MSSQLserver? > >Try this: > >FConn.DatabaseName:=FDatabase; >FConn.HostName:=FDatabaseServer; >FConn.Params.Add('Provider=SQLOLEDB.1'); >FConn.Params.Add('Persist Security Info=False'); >FConn.Params.Add('Network Library=DBMSSOCN'); >FConn.UserName:=FDbUser; >FConn.PasswWord:=FDBPassword; > >it is all pretty generic. I am not
Re: [Lazarus] Porting Delphi (2007/XE5) application, how to handle ADODB?
On Mon, 23 Jan 2023 09:59:14 +0100 (CET), Michael Van Canneyt via lazarus wrote: > > >On Mon, 23 Jan 2023, Bo Berglund via lazarus wrote: > >> I have a number of "older" applications developed on Windows using >> Delphi7-2007-XE5, which use ADODB for database accesses. >> The database is Microsoft SQLSERVER. >> >> Now I no longer have the old Borland software installed (issues with Windows >> 10 >> etc) so I want to port the projects to FPC/Lazarus. >> I have ported some other non-database applications which (with some effort) >> seems to have worked out OK. >> >> Now I am facing the challenge of doing it on an adodb database enabled >> application and I would like to know if there is some "compatible" way of >> doing >> it, which is described somewhere? > >Yes. > >You need to use SQLDB, and the TMSSQLConnection. > >See https://wiki.freepascal.org/SQLdb_Tutorial1 for a simple explanation. > >The page https://wiki.freepascal.org/SQLdb_Package also contains some >explanations >for setup. > >There are some other pages in the wiki. > >A more in-depth explanation is in the lazarus book. > >Or you can look at > >https://www.freepascal.org/~michael/articles/ > >several articles discuss SQLDB, in particular: > >https://www.freepascal.org/~michael/articles/lazviddb/lazviddb.pdf > >That should be enough to get you started. > >Michael. Thanks! Almost there but not quite... I am using Lazarus 2.2.4 with fpc 3.2.2 on a Windows 10 box. The application seems to have been converted pretty well using the Lazarus Delphi Conversion function to migrate from Delphi with some extra defines needing adjustments. But these have been minor considering the size of the application. But the ADODB conversion is now halted on the TSqlQuery and TMSSQLConnection items which operate so differently from ADODB... I added this in uses: mssqlconn, //Had to add this in order to use TMSSQLConnection sqldb, This made the code pass the defines of the objects: TAppDbHandler = class private FConn: TMSSQLConnection; // TADOConnection; FQuery: TSQLQuery;// TADOQuery; FDatabaseServer, FDatabase, FConnString, FDbUser, FDbPassword, FUserName, FUserPassword: string; But next I get a lot of errors because of the differences between this and the Delphi ADODB we used before. I got lost here... constructor TAppDbHandler.Create; begin FConn := TMSSQLConnection.Create(NIL); //was: TADOConnection.Create(NIL); FQuery := TSQLQuery.Create(NIL); //was: TADOQuery.Create(NIL); FQuery.Connection := FConn; //<== Triggers an error FDatabaseServer := ReadRegString(HKEY_CURRENT_USER,'Software\...\AppManager','DatabaseServer','servername'); FDatabase := ReadRegString(HKEY_CURRENT_USER,'Software\...\AppManager','Database','APPMANAGER'); FConnString := 'Provider=SQLOLEDB.1;Persist Security Info=False;' + 'Network Library=DBMSSOCN;Data Source=' + FDatabaseServer + ';' + 'Initial Catalog=' + FDatabase; FDbUser := ''; FDbPassword := ''; end; Is there some example which does not use component drag-drop and properties settings in the GUI but does all of it in code towards MSSQLserver? That would probably help in setting up the database functions properly. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Fppkg reports RTL not installed - Lazarus 2.2.4/fpc 3.2.2 from sources on Ubuntu
On Thu, 9 Feb 2023 21:05:13 +0100, Martin Frb via lazarus wrote: >On 09/02/2023 20:24, Bo Berglund via lazarus wrote: >> On Thu, 09 Feb 2023 18:34:27 +0100, Bo Berglund via lazarus >> wrote: >> >>> What does this mean? >>> >>> I have never seen this before in my many years of Lazarus usage... >>> >>> And what should I do to rectify it? >>> >> I found this being discussed on gitlab: >> https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/35254 >> >> and >> >> https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/38684 >> >> >> Seems like there is no solution yet, am I right? >> >> So, should I just disregard it completely? >> >> >In Lazarus trunk it can be disabled > >But before that tuff. > When is the next release of Lazarus including this change due to be published? Version 2.2.4 seems to be quite old now. But I don't get it, every time I start up Lazarus in Ubuntu it pops up the dialog and no matter what I do inside it it is not accepted. If I start the IDE anyway from the dialog without doing anything it looks like Lazarus is working and I can build apps earlier built with 2.0.12. But shutting down Lazarus and then starting it, again shows the dialog. :-( And it seems to be looking for $HOME/.config/fppkg.cfg even though I am using separate install dirs for Lazarus 2.0.12 and 2.2.4 and the launch file lazarus_2.2.4.desktop contains --pcp=/home/bosse/.lazarus_2.2.4 So I would expect the location of the fppkg.cnf file to be inside that pcp dir, but it is not. Apart from that location (provided the fpc version is in play) there could be another location below $HOME/lib/fpc/3.2.2 that could be used, but the dialog does not accept that either. This is where make install for fpc copied a lot of files. >Try to delete the old config by hand. >Then -outside the IDE - use the latest (3.2.2) fppkg to create a new >config. (may or may not need the fpc install in PATH) Exactly what do you suggest here? - Which old config? File name and location please. - How do I use the new fpc to recreate it? I don't even know what it is Note that I must be able to run my existing Lazarus 2.0.12 until everything with 2.2.4 has been checked to work.. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Fppkg reports RTL not installed - Lazarus 2.2.4/fpc 3.2.2 from sources on Ubuntu
On Thu, 09 Feb 2023 18:34:27 +0100, Bo Berglund via lazarus wrote: >What does this mean? > >I have never seen this before in my many years of Lazarus usage... > >And what should I do to rectify it? > I found this being discussed on gitlab: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/35254 and https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/38684 Seems like there is no solution yet, am I right? So, should I just disregard it completely? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Fppkg reports RTL not installed - Lazarus 2.2.4/fpc 3.2.2 from sources on Ubuntu
The below is from an Ubuntu 20.04.5 LTS with Mate Desktop on an HP workstation laptop. I have retrieved the tagged release sources for fpc 3.2.2 and Lazarus 2.2.4 from gitlab and built the compiler and IDE on the command line. When I start the Lazarus IDE I get to the dialog "Welcome to Lazarus IDE 2.2.4" where all is well and dandy *EXCEPT* the last tab Fppkg... What it says is this: --- File: /home/bosse/.config/fppkg.cfg Error: there is a problem with the Fppkg configuration. (Fppkg reports that the RTL is not installed.) You could try to restore the configuration files automatically, or adapt the configuration file manually. In the root of $HOME I have files fppkg.cfg, fppkg.bak, .fpc.cfg and directory fppkg/ This machine also has an older version of Lazarus (2.0.12) with fpc 3.2.0, which runs just fine without this noise about fppkg. The same thing regarding fppkg happens on Windows 10 with Lazarus 2.2.4 installed using the official installer downloaded from Sourceforge. What does this mean? I have never seen this before in my many years of Lazarus usage... And what should I do to rectify it? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Install Lazarus 2.2.4 on Ubuntu 20.04 LTS and other Linux
On Thu, 9 Feb 2023 11:50:25 +0100, John Landmesser via lazarus wrote: > git clone https://gitlab.com/freepascal.org/lazarus/lazarus.git lazarus > So I have found that this is a path forward: FPCTAG=release_3_2_2 FPCVER=3.2.2 LAZTAG=lazarus_2_2_4 LAZVER=2.2.4 ... cd $HOME/devel/fpc wget https://gitlab.com/freepascal.org/fpc/source/-/archive/$FPCTAG/source-$FPCTAG.tar.gz tar -xvf source-$FPCTAG.tar.gz mv source-$FPCTAG $FPCVER rm source-$FPCTAG.tar.gz cd $HOME/devel/lazarus wget https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/$LAZTAG/lazarus-$LAZTAG.tar.gz tar xvf lazarus-$LAZTAG.tar.gz mv lazarus-$LAZTAG 2.2.4 rm lazarus-$LAZTAG.tar.gz This brings over just the sourcefiles for fpc and lazarus into the correct directories with no extra stuff. Then the remainder of my install script should work (not yet done though). -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Install Lazarus 2.2.4 on Ubuntu 20.04 LTS and other Linux
On Thu, 9 Feb 2023 11:50:25 +0100, John Landmesser via lazarus wrote: > > ' old svn code: > > # svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus > > new code ( git needs to be installed ) > > git clone https://gitlab.com/freepascal.org/lazarus/lazarus.git lazarus > Thanks, I have been doing this: svn co https://svn.freepascal.org/svn/fpc/tags/$FPCTAG/ $FPCVER svn co https://svn.freepascal.org/svn/lazarus/tags/$LAZTAG/ $LAZVER where the variables have been preset to for example FPCTAG=release_3_2_0 FPCVER=3.2.0 LAZTAG=lazarus_2_0_12 LAZVER=2.0.12 I have made sure that only tagged (stable) releases are used in my script. This could also be formulated like this to disconnect from the source repository: svn export https://svn.freepascal.org/svn/fpc/tags/$FPCTAG/ $FPCVER My problem with git clone is that it will pull way to much from the repository, basically *all* that has happened up until today and it would also get me the live development sources, which I do not want. git clone makes the local store contain everything past and present, right? Is there a way use git to: - Only get a specific release tag (how do I find which tag to use) - Only get the actual sources without the overhead (AKA export) I have not used GIT for anything myself, we are on Subversion -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Install Lazarus 2.2.4 on Ubuntu 20.04 LTS and other Linux
Need help after fpc/lazarus moved from subversion... So I have been using Lazarus/FPC on Linux for a long time now (12+ years) and I have installed from sources using subversion access to the release tags on the source svn server. I created a script I could use on all these platforms to do the complete installations of fpc, lazarus, dependencies and custom components etc. This has been done on various Linux distros like Ubuntu 14-16-18-20 and RaspberryPi since about 2014 until 2020 or so. Now after having paused my programming a bit over the Covid pandemic I am back and need to update my installations by adding the newest version 2.2.4. But meanwhile the subversion server I have used has been replaced by some other versioning system so my script does no longer work... So I am asking how can I install from scratch on Linux (Ubuntu on PC and PiOS for RaspberryPi) in such a way that the older versions can remain in place? I googled a bit and found references to some deb files to download and use as sources, but then was also stated that installing one version would remove any other (earlier or later) existing version, which I surely do not want. I need the 2.2.4 version to exist in parallel with my older versions 2.0.6, 2.0.8, 2.0.10 and 2.0.12, so I can still build my applications with either of them... Please advice! PS I also have Lazarus installed on Windows-10 but this is done using the official sourceforge installers (i.e. not from source) and has resulted in separate installations for these versions so I can build my code also for Windows. DS -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Porting Delphi (2007/XE5) application, how to handle ADODB?
On Mon, 23 Jan 2023 09:59:14 +0100 (CET), Michael Van Canneyt via lazarus wrote: >That should be enough to get you started. > >Michael. Thanks! I will go there and check what I can do. I believe that I have isolated the DB stuff fairly well so hopefully only a few procedures need be touched. I have NOT dropped components onto a Dataform for example (I think that was the name used in Delphi where you could drop invisible components to get them into the RAD system. Long time ago now, though...) -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Porting Delphi (2007/XE5) application, how to handle ADODB?
I have a number of "older" applications developed on Windows using Delphi7-2007-XE5, which use ADODB for database accesses. The database is Microsoft SQLSERVER. Now I no longer have the old Borland software installed (issues with Windows 10 etc) so I want to port the projects to FPC/Lazarus. I have ported some other non-database applications which (with some effort) seems to have worked out OK. Now I am facing the challenge of doing it on an adodb database enabled application and I would like to know if there is some "compatible" way of doing it, which is described somewhere? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] How to list available serial orts on Ubuuntu?
On Mon, 28 Nov 2022 14:48:20 +0100, Giuliano Colla via lazarus wrote: >/dev/tty* is pretty much useless. It's there for historical reasons. >/dev/ttyS* is the one for actual serial adapters, and, unless you >override with a command line parameter on boot, it is limited to 0..3 in >modern kernels. > Here is what I get on Ubuntu 20.04.5 LTS: $ ll /dev/ttyS* crw-rw 1 root dialout 4, 64 2022-11-26 08:47 /dev/ttyS0 crw-rw 1 root dialout 4, 65 2022-11-26 08:47 /dev/ttyS1 crw-rw 1 root dialout 4, 74 2022-11-26 08:47 /dev/ttyS10 crw-rw 1 root dialout 4, 75 2022-11-26 08:47 /dev/ttyS11 crw-rw 1 root dialout 4, 76 2022-11-26 08:47 /dev/ttyS12 crw-rw 1 root dialout 4, 77 2022-11-26 08:47 /dev/ttyS13 crw-rw 1 root dialout 4, 78 2022-11-26 08:47 /dev/ttyS14 crw-rw 1 root dialout 4, 79 2022-11-26 08:47 /dev/ttyS15 crw-rw 1 root dialout 4, 80 2022-11-26 08:47 /dev/ttyS16 crw-rw 1 root dialout 4, 81 2022-11-26 08:47 /dev/ttyS17 crw-rw 1 root dialout 4, 82 2022-11-26 08:47 /dev/ttyS18 crw-rw 1 root dialout 4, 83 2022-11-26 08:47 /dev/ttyS19 crw-rw 1 root dialout 4, 66 2022-11-26 08:47 /dev/ttyS2 crw-rw 1 root dialout 4, 84 2022-11-26 08:47 /dev/ttyS20 crw-rw 1 root dialout 4, 85 2022-11-26 08:47 /dev/ttyS21 crw-rw 1 root dialout 4, 86 2022-11-26 08:47 /dev/ttyS22 crw-rw 1 root dialout 4, 87 2022-11-26 08:47 /dev/ttyS23 crw-rw 1 root dialout 4, 88 2022-11-26 08:47 /dev/ttyS24 crw-rw 1 root dialout 4, 89 2022-11-26 08:47 /dev/ttyS25 crw-rw 1 root dialout 4, 90 2022-11-26 08:47 /dev/ttyS26 crw-rw 1 root dialout 4, 91 2022-11-26 08:47 /dev/ttyS27 crw-rw 1 root dialout 4, 92 2022-11-26 08:47 /dev/ttyS28 crw-rw 1 root dialout 4, 93 2022-11-26 08:47 /dev/ttyS29 crw-rw 1 root dialout 4, 67 2022-11-26 08:47 /dev/ttyS3 crw-rw 1 root dialout 4, 94 2022-11-26 08:47 /dev/ttyS30 crw-rw 1 root dialout 4, 95 2022-11-26 08:47 /dev/ttyS31 crw-rw 1 root dialout 4, 68 2022-11-26 08:47 /dev/ttyS4 crw-rw 1 root dialout 4, 69 2022-11-26 08:47 /dev/ttyS5 crw-rw 1 root dialout 4, 70 2022-11-26 08:47 /dev/ttyS6 crw-rw 1 root dialout 4, 71 2022-11-26 08:47 /dev/ttyS7 crw-rw 1 root dialout 4, 72 2022-11-26 08:47 /dev/ttyS8 crw-rw 1 root dialout 4, 73 2022-11-26 08:47 /dev/ttyS9 32 in all... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] How to list available serial orts on Ubuuntu?
On Mon, 28 Nov 2022 14:44:27 +0100, "Carlos E. R. via lazarus" wrote: >> I had thought of this but it looked like an overly complicated way given that >> the list of tty* ports using ls -l /dev/tty* on my system comprises no less >> than >> 98 hits > >Please see my post. It is not tty* OK, doing /dev/ttyS* reduces the hits to 32... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] How to list available serial orts on Ubuuntu?
On Mon, 28 Nov 2022 13:31:12 +0100, Giuliano Colla via lazarus wrote: >Hope that it helps, Thanks, it does. I had thought of this but it looked like an overly complicated way given that the list of tty* ports using ls -l /dev/tty* on my system comprises no less than 98 hits So I am now limiting the program to use USB connected serial adapters USB0..USB3 and on start I populate the list of ports by checking that /dev/USBx eists where x is 0..3. After all this is the most common use nowadays with USB serial devices in connection with developing IoT devices. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] How to list available serial orts on Ubuuntu?
I haved a debugging tool program created on Windows and I am orting it to Linux Ubuntu. It seems to build just fine except for a combobox fill function which uses the Windows way of populating the selectoer box with the serial ports available on the system. This is the code I use on Windows: function THanSimulatorMain.ListSerialPorts(LS: TStrings): integer; var I:integer; {$ifdef MSWINDOWS} Reg:tregistry; {$endif} begin {$ifdef MSWINDOWS} //List available serial ports on Windows: Reg := TRegistry.Create; try Reg.RootKey := HKEY_LOCAL_MACHINE; if Reg.OpenKeyReadOnly('HARDWARE\DEVICEMAP\SERIALCOMM') then begin LS.Clear; Reg.GetValueNames(LS); for I := 0 to LS.Count - 1 do LS[i] := Reg.ReadString(LS[i]); end; Result := LS.Count; finally Reg.Free; end; {$endif} {$ifdef UNIX} //List available serial ports on Linux: //What do I put here? {$endif} end; I have looked at /dev/tty* but it lists a large number of items which makes it impossible for me. I do not belive all of´them are real serial ports... What can I do to get a selector for real serial ports on Ubuntu. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] How to fix slow screen refresh of TListbox?
On Sun, 20 Nov 2022 18:21:56 -0300, Flávio Etrusco via lazarus wrote: >I see. My point is that you don't need to copy the whole DataBuffer and >re-populate the whole SynEdit each time you receive new data. But this >probably won't matter much unless you have hundreds of thousands of lines >running on not so recent hardware. Well, I tried at first to add incoming data to the bottom of the window, but it turned out that when the transfer of data had been cut into parts by the serial buffer such that the OnRxdata() triggered several times during the transfer then the line at which the trigger happened was cut in two in the middle of the screen. Apparently the extra line break that was not part of the transfer was added by the control when the data was added to the end. Next data added to it was not adjacent to the last previous character but placed on the start of the next line... So the data in the synedit always ended with a linefeed even though there was not yet any such in the transfered data. Therefore I decided to use a dynamic TBytes array, which I could expand the size of whenever the data arrived to fit the new packet and put it at the end of the buffer. Then I just replaced the strings in the display control with the full buffer every time. This way lines are not visibly cut in half or worse But it would be better if I could have kept the data in the SynEdit itself and just expanded with new data as they arrived by putting them at the end... Not so much to transfer then. Just new arriving text. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] How to fix slow screen refresh of TListbox?
On Fri, 18 Nov 2022 18:40:57 -0300, Flávio Etrusco via lazarus wrote: >Em dom., 13 de nov. de 2022 às 18:36, Luca Olivetti via lazarus < >lazarus@lists.lazarus-ide.org> escreveu: > >> El 12/11/22 a les 12:13, Bo Berglund via lazarus ha escrit: >> > On Sat, 12 Nov 2022 09:45:15 +0100, Luca Olivetti via lazarus >> > wrote: >> > >> >> El 11/11/22 a les 23:37, Bo Berglund via lazarus ha escrit: >> >> >> >>> But how to jump to the end of the text on screen? >> >>> >> >> >> >> TheSynEdit.TopLine:=TheSynEdit.Lines.Count-TheSynEdit.LinesInWindow+1 >> >> >> > >> > Did not work, but this does work: >> >> Strange, I've been using it for many years (and still use it) to ensure >> the last line is visible. >> >> (...) >> -- >> Luca Olivetti >> Wetron Automation Technology http://www.wetron.es/ >> Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 >> > > It should work. Or even straight >"TheSynEdit.TopLine:=TheSynEdit.Lines.Count;'. My current version of my logging tool application uses this to display incoming data on the serial port (where it ends up in the TBytes buffer DataBuffer[] before displaying): ... SetLength(DataTxt, Length(DataBuffer)); //Set string length Move(DataBuffer[0], DataTxt[1], Length(DataBuffer)); //Copy data to string {$ifdef USESYNEDIT} synRxData.Lines.Beginupdate; synRxData.Lines.Text := DataTxt; synRxData.CaretY := synRxData.Lines.Count; synRxData.Lines.Endupdate; stxLineCount.Caption := IntToStr(synRxData.Lines.Count); {$else} ... Right now it has been running since 2022-11-19 01:20:05 and contains 11936 log lines and whenever new data arrive it is almost instant on screen when it loads the new lines and displays the very bottom of the list... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus