Recent

Author Topic: Trying to compile a small program for Linux Mint  (Read 942 times)

regressist

  • New Member
  • *
  • Posts: 20
Trying to compile a small program for Linux Mint
« on: November 02, 2024, 05:06:52 pm »
Hi all,
I am surely asking idiotic questions, sorry for that. I run Lazarus on a virtual machine with win XP. I do not know much the tool but I am able to compile a simple program written by me to perform some enormous computations with integers, no input, output is just a bunch on numbers on screen and in a text file. No class, graphics, etc. just basic. I am able to compile for windows without a glitch.
Now I have at hand a spare desktop with Linux Mint (which for me is totally new subject), I would like to compile also for that.
I went into Project options and set as target OS Linux. The cpu for linux is   i5-7200 anyway I left default for family and cpu.
When I click OK I get the error:

The project uses target OS=linux and CPU=i386.
The system.ppu  for this target was not found in the FPC binary directories
Make sure fpc is installed correctly for this target and the fpc.cfg contains the right directories.

Please let me know if you have the time

Thanks in advance to whomever will reply

Josh

  • Hero Member
  • *****
  • Posts: 1344
Re: Trying to compile a small program for Linux Mint
« Reply #1 on: November 02, 2024, 05:22:31 pm »
Hi

If you left them on default, then the project should run as is; on nearly all platforms.

I suspect you have a 64bit Os, 64 Bit Laz and FPC and then your telling it to compile and run an 32 bit application(I386),boom.

This can work if you also install the 64-32bit cross compiler.

The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Thaddy

  • Hero Member
  • *****
  • Posts: 16138
  • Censorship about opinions does not belong here.
Re: Trying to compile a small program for Linux Mint
« Reply #2 on: November 02, 2024, 05:29:45 pm »
Maybe you need multiarch installed for mint, but since I am not a fan of mint (because it is not so "mint", it one of the most problematic big distro's ) You have to check that yourself. Or you need the correct compiler, as mentioned: if multiarch is not installed on a 64 bit system, 32 bit binaries won't work without multiarch. In that case you install 64 bit Lazarus and 64 bit Fpc as mentioned before.
« Last Edit: November 02, 2024, 05:47:20 pm by Thaddy »
If I smell bad code it usually is bad code and that includes my own code.

Handoko

  • Hero Member
  • *****
  • Posts: 5374
  • My goal: build my own game engine using Lazarus
Re: Trying to compile a small program for Linux Mint
« Reply #3 on: November 02, 2024, 05:53:25 pm »
@regressist

Were you running Lazarus on Windows and trying to generate binary for Linux? If yes, then you have to prepare the cross compiler first. You can search the wiki or forum about preparing the cross compiler.
« Last Edit: November 02, 2024, 08:30:37 pm by Handoko »

Bart

  • Hero Member
  • *****
  • Posts: 5465
    • Bart en Mariska's Webstek
Re: Trying to compile a small program for Linux Mint
« Reply #4 on: November 02, 2024, 05:56:29 pm »
It's easier to just run Lazarus on Linux Mint and compile the code there.

Bart

LV

  • Full Member
  • ***
  • Posts: 153
Re: Trying to compile a small program for Linux Mint
« Reply #5 on: November 02, 2024, 06:06:51 pm »
1. Cross-compiling.
https://wiki.lazarus.freepascal.org/Cross_compiling

2.
It's easier to just run Lazarus on Linux Mint and compile the code there.

Bart

The easiest and most reliable way. This is what I usually do.

Updated: see also the recent discussion
https://forum.lazarus.freepascal.org/index.php/topic,68926.0.html

« Last Edit: November 02, 2024, 06:22:43 pm by LV »

TRon

  • Hero Member
  • *****
  • Posts: 3618
Re: Trying to compile a small program for Linux Mint
« Reply #6 on: November 02, 2024, 08:26:14 pm »
Updated: see also the recent discussion
https://forum.lazarus.freepascal.org/index.php/topic,68926.0.html
That thread applies specifically to macos (specifically with Mx chip) so unless that applies to your situation I would advise not to focus to much on that thread.

If you require more information then please share what host OS/arch you are using, how the current existing/used Lazarus and Free Pascal was setup and what you aim is. That is the only way to be able to provide specific information.
This tagline is powered by AI

MarkMLl

  • Hero Member
  • *****
  • Posts: 7999
Re: Trying to compile a small program for Linux Mint
« Reply #7 on: November 02, 2024, 08:33:05 pm »
If you require more information then please share what host OS/arch you are using, how the current existing/used Lazarus and Free Pascal was setup and what you aim is. That is the only way to be able to provide specific information.

The entire content of /etc/os-release might be useful.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

regressist

  • New Member
  • *
  • Posts: 20
Re: Trying to compile a small program for Linux Mint
« Reply #8 on: November 02, 2024, 08:45:25 pm »
Thanks a lot to everybody,

I think this is too complex for me. Two or 3 years ago I compiled for Android (in practice useless because phones/tablets are too slow) with the help of a guy who made me select the target processor, then gave me the zip of files needed by the linker (he said Android NDK [?]). And that was it, I thought here it would be the same.
I will try to install Lazarus on Linux, I hope it is not so hard, maybe it is more interesting too, I have to learn anyway how to install in Linux!

Anyway I am on win10 as host, then a VMware virtual machine with win XP (32bit) were there is Lazarus.

LV

  • Full Member
  • ***
  • Posts: 153
Re: Trying to compile a small program for Linux Mint
« Reply #9 on: November 02, 2024, 09:04:03 pm »
A year ago, I was in your position.
I will try to install Lazarus on Linux, I hope it is not so hard, maybe it is more interesting too, I have to learn anyway how to install in Linux!
This is the path I chose.
Good luck.

 

TinyPortal © 2005-2018