Recent

Author Topic: Issues with Free Pascal Compiler version 3.2.2+dfsg-9ubuntu1 in Ubuntu 22.04  (Read 2069 times)

bloxorz

  • Newbie
  • Posts: 5
Hi, I have tried to compile the saludar.pas program in Ubuntu 22.04 and received the following errors:

(3,1): Fatal: Can't find unit system used by Saludar.
(0): Fatal: Compilation aborted.
Error: /usr/bin/ppcx64 returned an error exitcode.




Bogen85

  • Hero Member
  • *****
  • Posts: 595
Hi, I have tried to compile the saludar.pas program in Ubuntu 22.04 and received the following errors:

(3,1): Fatal: Can't find unit system used by Saludar.
(0): Fatal: Compilation aborted.
Error: /usr/bin/ppcx64 returned an error exitcode.

Can you attach the program or include it in a code block?

Also, if the source file is not in an empty directory, could you include a listing of the files in that directory?

If you get the same error message when the source file is in an empty directory, then the file listing is not needed.

bloxorz

  • Newbie
  • Posts: 5
Sure,

Code: Pascal  [Select][+][-]
  1. PROGRAM Saludar;
  2.  
  3. BEGIN
  4. write('hola mundo');
  5. END.
  6.  

What's a source file? My program is located in the home directory.

tetrastes

  • Sr. Member
  • ****
  • Posts: 482
Hi, I have tried to compile the saludar.pas program in Ubuntu 22.04 and received the following errors:

(3,1): Fatal: Can't find unit system used by Saludar.
(0): Fatal: Compilation aborted.
Error: /usr/bin/ppcx64 returned an error exitcode.

How did you install fpc?

bloxorz

  • Newbie
  • Posts: 5
I downloaded fpc-3.2.0-x86_64-linux.tar into a folder called tmp. Then I used the command tar -xvf to extract the files. Then I did cd fpc-3.2.0.x86_64-linux and ./install.sh, PATH=~/fpc-3.2.2/bin:$PATH, then echo 'PATH=~/fpc-3.2.2/bin:$PATH' >> ~/.profile.

This is my path file:
Code: Bash  [Select][+][-]
  1. /home/felipe/fpc-3.2.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
  2.  

After that I did sudo apt install fp-compiler-3.2.2 and then sudo apt install fp-ide-3.2.2

tetrastes

  • Sr. Member
  • ****
  • Posts: 482
So you messed two installations. Try to apt purge those you installed by apt.

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
(3,1): Fatal: Can't find unit system used by Saludar.

Hello.

Check your fpc.cfg file used by /usr/bin/ppcx64.
It is probably located in /etc/fpc.cfg

Edit it and adapt the -Fu's with the path where fpc-compiled units are installed.
Code: Bash  [Select][+][-]
  1. # searchpath for units and other system dependent things

Save it and re-try.
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

bloxorz

  • Newbie
  • Posts: 5
Quote
Edit it and adapt the -Fu's with the path where fpc-compiled units are installed.

I was able to get to the file you told me, but I don't understand how to adapt the Fu's you mention. What do you mean with fpc-compiled units?


Code: Bash  [Select][+][-]
  1. # searchpath for units and other system dependent things
  2. -Fu/usr/lib/x86_64-linux-gnu/fpc/$fpcversion/units/$fpctarget
  3. -Fu/usr/lib/x86_64-linux-gnu/fpc/$fpcversion/units/$fpctarget/*
  4. -Fu/usr/lib/x86_64-linux-gnu/fpc/$fpcversion/units/$fpctarget/rtl
  5.  

TRon

  • Hero Member
  • *****
  • Posts: 2537
I was able to get to the file you told me, but I don't understand how to adapt the Fu's you mention. What do you mean with fpc-compiled units?
The latter refers to files that have the extension ppu.

Does your system actually have a path "/usr/lib/x86_64-linux-gnu/fpc/3.2.2/units/x86_64-linux" ?

Try to locate where the path actually is and then modify the -Fu entries accordingly.

You can use the $fpcversion and $fpctarget macros to replace the actual version (3.2.2) and target (x86_64-linux) of your installed compiler.

edit BTW:

I downloaded fpc-3.2.0-x86_64-linux.tar into a folder called tmp. Then I used the command tar -xvf to extract the files. Then I did cd fpc-3.2.0.x86_64-linux and ./install.sh, PATH=~/fpc-3.2.2/bin:$PATH, then echo 'PATH=~/fpc-3.2.2/bin:$PATH' >> ~/.profile.
Is the name of the tar file you downloaded a typo (3.2.0) ?


Quote
This is my path file:
Code: Bash  [Select][+][-]
  1. /home/felipe/fpc-3.2.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
  2.  
... because if it is not a typo then you have used the wrong path.

Quote
After that I did sudo apt install fp-compiler-3.2.2 and then sudo apt install fp-ide-3.2.2
And mismatching versions that way is probably going to be ugly.
« Last Edit: March 11, 2023, 01:50:33 am by TRon »

bloxorz

  • Newbie
  • Posts: 5
Quote
Is the name of the tar file you downloaded a typo (3.2.0) ?

No, in fact the installer version is 3.2.0 in SourceForge: http://sourceforge.net/projects/freepascal/files/Linux/3.2.2

Quote
Try to locate where the path actually is and then modify the -Fu entries accordingly.

Like this?

Code: Bash  [Select][+][-]
  1. # searchpath for units and other system dependent things
  2. -Fu/usr/lib/x86_64-linux-gnu/fpc/3.2.2/units/x86_64-linux
  3. -Fu/usr/lib/x86_64-linux-gnu/fpc/3.2.2/units/x86_64-linux/*
  4. -Fu/usr/lib/x86_64-linux-gnu/fpc/3.2.2/units/x86_64-linux/rtl
  5.  

Quote
... because if it is not a typo then you have used the wrong path.

Do I need to edit the path?

TRon

  • Hero Member
  • *****
  • Posts: 2537
Quote
Is the name of the tar file you downloaded a typo (3.2.0) ?

No, in fact the installer version is 3.2.0 in SourceForge: http://sourceforge.net/projects/freepascal/files/Linux/3.2.2
.... and the file located there is named "fpc-3.2.2.x86_64-linux.tar" and not " fpc-3.2.0-x86_64-linux.tar"

These are two completely different tar files.


Quote
Like this?
No, not exactly :)

You need to locate where you installed the unit files (you have installed FPC on your system and I have no clue what location you used to install the complementary unit files). The location where those files are located is named a path (not to confuse with a system search path that is used for searching directories in order to locate executable files).

Quote
Do I need to edit the path?
The -Fu paths located in the fpc.cfg file, yes in case that location does not match the location where your units files are actually located. You do not need to replace the version number and target macro's, only point -Fu to the correct location (path) where your units are located (where you have installed them to).

But the point of that remark was that if you actually used the 3.2.0 tar archive and also have FPC 3.2.2 installed that things are becoming a bit messy. It is currently not even clear if you installed 3.2.0 and 3.2.2 together (one using the package manager of your distribution and the other using the tar archive and installed into your home directory) because something like that is not going to work.



edit: and I am a bit slow as user tetrastes already figured that so please follow his suggestion.
« Last Edit: March 11, 2023, 05:19:03 am by TRon »

 

TinyPortal © 2005-2018