Error exclusive to Mint (Mate) when starting my program

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
MikeFinch
Level 1
Level 1
Posts: 13
Joined: Mon May 17, 2021 7:29 pm

Re: Error exclusive to Mint (Mate) when starting my program

Post by MikeFinch »

AndyMH >

It has happened AGAIN!! I checked the top RHS (under Search . . .) and it displayed 'MikeFinch' showing I am 'connected' : when I'm not.

Spend ages creating a reply only to discover I'm wasting my time . . . There should be a warning that you have say, 60 seconds left to stay active.

I'll try once more to send four targz files. Hope you can compile in Lazarus IDE OK.

[html.tar.gz contains a folder called 'html' : it has a warning triangle - the other three are ticked. If you don't get it I will have to split it up. At least I didn't get the 'too large' error!]]

This is a personal project - mass indifference in the croquet community - so don't take seriously 'copyright' and addresses please - I'm hoping i won't get into some sort of potential legal trouble with CAQ.

MikeFinch
Attachments
MSPairings_source.tar.gz
(179.48 KiB) Downloaded 32 times
MSPairings_source_1.tar.gz
(16.9 KiB) Downloaded 27 times
playerDB.dat.tar.gz
(43.33 KiB) Downloaded 27 times
User avatar
AndyMH
Level 21
Level 21
Posts: 13757
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Error exclusive to Mint (Mate) when starting my program

Post by AndyMH »

Where is the main project file? e.g. yourproject.lpr. I see lots of units no main file, content is typically:

Code: Select all

program foxclone50;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  sysutils, Forms, mainform, drives, noteform;

{$R *.res}

begin
  RequireDerivedFormResource:=True;
  Application.Scaled:=True;
  Application.Initialize;
  Application.CreateForm(TMainFM, MainFm);
  Application.Run;
end.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
MikeFinch
Level 1
Level 1
Posts: 13
Joined: Mon May 17, 2021 7:29 pm

Re: Error exclusive to Mint (Mate) when starting my program

Post by MikeFinch »

AndyMH > yes the fourth file didn't transmit even though it didn't say "too large". But it was the only one without a green tick.

Will have to devise a way to send the omitted info - busy playing with csv / Qt Creator at the moment . . .

Will get round to it soon (famous last words).
User avatar
AndyMH
Level 21
Level 21
Posts: 13757
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Error exclusive to Mint (Mate) when starting my program

Post by AndyMH »

No rush, good weather, lots to do in the garden.

EDIT - have PM'ed you.
Last edited by AndyMH on Sun Jun 13, 2021 11:45 am, edited 1 time in total.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
DPM
Level 4
Level 4
Posts: 430
Joined: Thu Sep 24, 2020 9:21 am

Re: Error exclusive to Mint (Mate) when starting my program

Post by DPM »

I still think that the basic problem is that you try to do things you shouldn't do in the first place. There is no reason to get to the program's path. Individual user data have their place under /home/.config and /home/.local/share (unless given otherwise by environment variables), and data for all users should be under /usr/share/ or /usr/local/share.

Develop the software properly as it should be done under Linux, and you don't have the path problem.
MikeFinch
Level 1
Level 1
Posts: 13
Joined: Mon May 17, 2021 7:29 pm

Re: Error exclusive to Mint (Mate) when starting my program

Post by MikeFinch »

AndyMH > As far as I can see I only have to send you the .lpi file (so attached - "invalid file extension" - so I'll substitute "zip" for "lpi" instead! ).

The (presumably) object files .o and .or seem to be generated on compile. What was concerning me was the large .obj file - but apparently file this is a hangover from earlier Lazarus versions and doesn't seem to be needed now. [The .ppu (and already mentioned .o) files seem to be compile created].

I hope you now have all the files needed to create/run the program. Any constructive comments are welcomed - at least you might be interested (as well as only me!). Then you can do the checks necessary to observe my problem . . .

DPM > I don't understand why you think I am not using linux / lazarus "properly". I am sure you are trying to be helpful, so thanks for that. Now you have the files you should be able to create the executable and do the tests for the problem I seem to have - and drive home to me any faulty programming style.

MikeFinch
Attachments
MSPairings.zip
(13.76 KiB) Downloaded 27 times
DPM
Level 4
Level 4
Posts: 430
Joined: Thu Sep 24, 2020 9:21 am

Re: Error exclusive to Mint (Mate) when starting my program

Post by DPM »

MikeFinch wrote: Sun Jun 13, 2021 10:30 pmNow you have the files
The ZIP file can't be opened.

The issue you reported was that the working directory is not set to where the executable is, and you need that path to open a data file that you put in the executable path. The latter is not how you do it on Linux because the executables are usually supposed to be in some /bin directory such as /usr/bin, /usr/local/bin etc., and they are not supposed to put additional data files there. The data files, see my postings above, are supposed to be located somewhere else, not in the executable path. If you put them where they should be, then you don't have the original problem with the working directory, i.e. then you don't need the program's directory in the first place.

Actually, it's the same under Windows where programs are not supposed to write into their installation path under c:\programs\appname. That used to be frequent under Windows XP although it was not the proper way already back then, but latest with Windows 7 ten years ago, that practice was not common anymore.
MikeFinch
Level 1
Level 1
Posts: 13
Joined: Mon May 17, 2021 7:29 pm

Re: Error exclusive to Mint (Mate) when starting my program

Post by MikeFinch »

DPM [and anyone else interested] > as I said the ".zip" file, which actually was accepted by the system, has to be renamed *.lpi. Trust you now have all the necessary files for a compile in Lazarus Pascal.

Re your last, what you seem to be saying is that Mint(Mate in this case) is correct and all the other OSs are wrong (please forgive the slight sarcasm). I have no trouble running my program with the datafile(s) in the working (same) directory in other OSs (including W10).

Should other OSs therefore be warning me that I am doing it wrongly?

Cheers :?
DPM
Level 4
Level 4
Posts: 430
Joined: Thu Sep 24, 2020 9:21 am

Re: Error exclusive to Mint (Mate) when starting my program

Post by DPM »

MikeFinch wrote: Mon Jun 14, 2021 10:22 pmI have no trouble running my program with the datafile(s) in the working (same) directory in other OSs (including W10).
Doesn't change a thing abot that being the wrong approach both under Linux and Windows. But OK, if you're absolutely set on implementing a wrong solution, then I'm out.
MikeFinch
Level 1
Level 1
Posts: 13
Joined: Mon May 17, 2021 7:29 pm

Re: Error exclusive to Mint (Mate) when starting my program

Post by MikeFinch »

Sorry DPM > but if it works then why not? Perhaps Mint is superior to the other OSs in that "my way" won't work??

So seemingly the rest are recalcitrant in allowing "my way" to operate? Since I am not conversant with the "bowels" of OSs I am unable to exercise technical insight.

I was hoping to check 20.2 re this difficulty but it's only Beta apparently. Probably the problem (from my point of view) won't change.

Thanks for contributors' interest anyway. (BTW did anyone manage to compile and run my program?)

Cheers . . .
Locked

Return to “MATE”