Recent

Author Topic: Fatal: Can't find unit System  (Read 8922 times)

smartduck

  • Newbie
  • Posts: 5
Fatal: Can't find unit System
« on: July 13, 2020, 07:15:13 pm »
Hello,

I hope someone can help me getting the freepascal ide compile.
I wrote a simple example hello world to test the ide.
When I try to run the program I get Fatal: Can't find unit System used by helloworld.

I have also installed Lazarus IDE. Programs in Lazarus compile and run fine.

I noticed fp putting the fp.cfg, fp.dsk, fp.ini and fp____.err in my home directory.

Regards,

Marcel

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Fatal: Can't find unit System
« Reply #1 on: July 13, 2020, 07:24:11 pm »
Seems you didn't installed it correctly.  What system are you using?
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

smartduck

  • Newbie
  • Posts: 5
Re: Fatal: Can't find unit System
« Reply #2 on: July 13, 2020, 07:50:00 pm »
I use fp 3.0.4 on AntiX linux 19.2.
What files are missing?




smartduck

  • Newbie
  • Posts: 5
Re: Fatal: Can't find unit System
« Reply #3 on: July 13, 2020, 08:03:11 pm »
Just reinstalled fp, still the same error.
Maybe something is broken in one of the AntiX repository packages.

Thaddy

  • Hero Member
  • *****
  • Posts: 15123
  • Censorship about opinions does not belong here.
Re: Fatal: Can't find unit System
« Reply #4 on: July 13, 2020, 08:30:58 pm »
Did your program explicitly refer to unit system? That is wrong. Remove any references to system and try again.
System is always included automatically.
If that does not work install with fpcupdeluxe which is the best option for starters with install troubles.
« Last Edit: July 13, 2020, 08:39:12 pm by Thaddy »
Of course the national anthem of the U.S.A. was written by Jimi Hendrix, didn't you know that?

smartduck

  • Newbie
  • Posts: 5
Re: Fatal: Can't find unit System
« Reply #5 on: July 14, 2020, 05:25:36 pm »
Just the example from the freepascal wiki:

Code: Pascal  [Select][+][-]
  1. program Hello;
  2. begin
  3.   writeln ('Hello, world.');
  4.   readln;
  5. end.
  6.  

Thaddy

  • Hero Member
  • *****
  • Posts: 15123
  • Censorship about opinions does not belong here.
Re: Fatal: Can't find unit System
« Reply #6 on: July 14, 2020, 06:20:03 pm »
Just the example from the freepascal wiki:

Code: Pascal  [Select][+][-]
  1. program Hello;
  2. begin
  3.   writeln ('Hello, world.');
  4.   readln;
  5. end.
  6.  

If that gives you that error your install is really screwed... Try uninstall (purge) and after that, fpcupdeluxe.
Of course the national anthem of the U.S.A. was written by Jimi Hendrix, didn't you know that?

jb007

  • Full Member
  • ***
  • Posts: 145
Re: Fatal: Can't find unit System
« Reply #7 on: April 17, 2023, 01:40:30 pm »
Hi,

aware of the fact that there hasn't been a post for 2 years, here solution that
works on my pi zero:

https://peppe8o.com/using-pascal-programming-language-with-raspberry-pi/

Step by step it shows how to set things!

Kind regards. Marcel
to DIY or not to DIY

af0815

  • Hero Member
  • *****
  • Posts: 1330
Re: Fatal: Can't find unit System
« Reply #8 on: April 17, 2023, 02:45:52 pm »
aware of the fact that there hasn't been a post for 2 years, here solution that
works on my pi zero:

https://peppe8o.com/using-pascal-programming-language-with-raspberry-pi/
Not working site if you use a adblocker/spamblocker/antitracing (for a good reason)
regards
Andreas

nikel

  • Full Member
  • ***
  • Posts: 203
Re: Fatal: Can't find unit System
« Reply #9 on: April 27, 2024, 11:08:12 pm »
I had the same problem.

I ran "fp" on a machine which has Lazarus installed. Then looked at Options > Directories. So I added following entries to the fp which was giving me error.

Units
/usr/lib/fpc/$fpcversion\units\$fpctarget
/usr/lib/fpc/$fpcversion\units\$fpctarget\*
/usr/lib/fpc/$fpcversion\units\$fpctarget\rtl

Libraries
/usr/lib/gcc/x86_64-linux-gnu/9

Attention: Some slashes are forward some are back. Also "build-essentials" is installed.

zamronypj

  • Full Member
  • ***
  • Posts: 138
    • Fano Framework, Free Pascal web application framework
Re: Fatal: Can't find unit System
« Reply #10 on: April 28, 2024, 02:02:40 am »
I encountered this kind of problem in the past. IIRC, it was because I installed using fpcupdeluxe and somehow FPC searched /etc/fpc.cfg and can not found it. I solved it by creating symlink /etc/fpc.cfg and point it to fpc.cfg from fpcupdeluxe. 
Fano Framework, Free Pascal web application framework https://fanoframework.github.io
Apache module executes Pascal program like scripting language https://zamronypj.github.io/mod_pascal/
Github https://github.com/zamronypj

 

TinyPortal © 2005-2018