Lỗi pascal cant find unit sysrem by

Discussion:

[fpc-pascal] FP IDE - can't find System unit

Hi,

What do I need to setup in the FP IDE to be able to compile a simple little app? FPC is setup in my PATH and I can compile the same project from the command line without problems.

fpc testversion.pas

Free Pascal Compiler version 2.1.5 [2007/08/10] for i386 Copyright (c) 1993-2007 by Florian Klaempfl Target OS: Linux for i386 Compiling testversion.pas Linking testversion 18 lines compiled, 0.1 sec

FP IDE: * Run FP * Open testversion.pas * Alt-F9 and I get the following error "Fatal: Can't find unit System used by testversion"

Any ideas? Sorry, it's the fist time I'm trying to use the FP IDE.

Regards, - Graeme -

What do I need to setup in the FP IDE to be able to compile a simple little app?

Set up the correct unit directories under Options->Directories

Jonas

Set up the correct unit directories under Options->Directories

So does that mean FP IDE doesn't read the global fpc.cfg file located it /etc or in my $HOME directory? If it doesn't, why not? It would make sense to do so?

BTW: I'm only trying to compile a very simple application, that doesn't use any units not included in FPC. I can understand that I need to add unit directories for 3rdParty libraries, but not sure why for units included with the Free Pascal Compiler (that's already setup in fpc.cfg).

Here is the source of testversion.pas

---[ testversion.pas ]--- program testversion;

{$mode objfpc}{$H+}

uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Classes;

begin WriteLn('Compiled date: ' + {$I %DATE%}); WriteLn('Version: ' + {$I %FPCVERSION%}); WriteLn('Free Pascal Compiler version ' + {$I %FPCVERSION%} + ' [' + {$I %FPCDATE%} + ']'); end. ----- END ------

Regards, - Graeme -

Set up the correct unit directories under Options->Directories

So does that mean FP IDE doesn't read the global fpc.cfg file located it /etc or in my $HOME directory? If it doesn't, why not? It would make sense to do so? I'm only trying to compile a very simple application, that doesn't use any units not included in FPC. I can understand that I need to add unit directories for 3rdParty libraries, but not sure why for units included with the Free Pascal Compiler (that's already setup in fpc.cfg).

Keep in mind that the cmdline compiler, and the IDE compiler are two separate instances of the compiler. The textmode has fpc.cfg, the IDE its own (possibly directory/project specific) settings.

Keep in mind that the cmdline compiler, and the IDE compiler are two separate instances of the compiler. The textmode has fpc.cfg, the IDE its own (possibly directory/project specific) settings.

Oh I see. So the FP IDE doesn't just call the textmode fpc (or ppc386) and parse the output into the messages window (like Lazarus does).

In that case I'll just copy the unit paths from my fpc.cfg file into the FP IDE (directories window).

Regards, - Graeme -

Set up the correct unit directories under Options->Directories

So does that mean FP IDE doesn't read the global fpc.cfg file located it /etc or in my $HOME directory? If it doesn't, why not? It would make sense to do so? I'm only trying to compile a very simple application, that doesn't use any units not included in FPC. I can understand that I need to add unit directories for 3rdParty libraries, but not sure why for units included with the Free Pascal Compiler (that's already setup in fpc.cfg).

Keep in mind that the cmdline compiler, and the IDE compiler are two separate instances of the compiler. The textmode has fpc.cfg, the IDE its own (possibly directory/project specific) settings.

I'd say the main reason is as follows: IDE maintains the configuration visually (i.e. in user friendlier way). It loads the configuration on startup from a file and saves it back every time one saves the configuration in IDE - at that point the file gets rewritten. In order to be able to load the file, IDE needs to understand its structure fully, which is difficult to achieve with the current file structure together with parallel manual maintenance of the file (for the command-line compiler not providing any other alternative).

Tomas

Loading...

Discussion:

fp looks for a unit System ?

(too old to reply)

[apologises for possibly wrong english] Hi, there

I've installed FreePascal 2.2.0 in my linux home, and I have fp in my PATH. I wish to run gavrasm, an assembler program for AVR microcontrollers (http://www.avr-asm-tutorial.net/gavrasm/index_de.html), but I can't make it to be compiled. Whenever I lauch fp within gavrasm top source tree or within freepascal installation dir, I've got the same error message:

Fatal : can't find unit System used by gavrasm.

Could somebody tell me what's fp exactly looking for, an how could I help it in getting it ?

-- Antonin

I've installed FreePascal 2.2.0 in my linux home, and I have fp in my PATH. I wish to run gavrasm, an assembler program for AVR microcontrollers (http://www.avr-asm-tutorial.net/gavrasm/index_de.html), but I can't make it to be compiled. Whenever I lauch fp within gavrasm top source tree or within freepascal installation dir, I've got the same error Fatal : can't find unit System used by gavrasm. Could somebody tell me what's fp exactly looking for, an how could I help it in getting it ?

Two possibilities: - clean your project directory of .ppu's and .o's from previous versions. - configure the path to the rtl in the textmode IDE's options ->directories ->units tab.

The unit paths you have to enter are (depending on exact distribution)

/usr/lib/fpc/2.2.0/units/i386-linux/* /usr/lib/fpc/2.2.0/units/i386-linux/

Some linux/unix distro's install in /usr/local/lib/.. instead of /usr/lib/.. though, check this first. (so once with, and once without asterisk)

Hello Marco

- clean your project directory of .ppu's and .o's - configure the path to the rtl in the textmode IDE's options ->directories ->units tab. Some linux/unix distro's install in /usr/local/lib/.. instead of /usr/lib/.. though, check this first. (so once with, and once without asterisk)

Thanks a lot. As it is installed in my homedir, the units dir have been found in $(HOME)/fpc-2.2.0/lib/fpc/2.2.0/units/i386-linux/ The dir could not be picked up by mouse click neither cut/pasted in the fpc IDE, so I mispelled it a bit before having it right. Oh, finally I've edited fp.cfg while fp was off... I had to remove once more all the .ppu's and .o's before fpc ran, as you suggested.

Now avrasm runs : thanks again.

-- Antonin

Hello Marco

- clean your project directory of .ppu's and .o's - configure the path to the rtl in the textmode IDE's options ->directories ->units tab. Some linux/unix distro's install in /usr/local/lib/.. instead of /usr/lib/.. though, check this first. (so once with, and once without asterisk)

Thanks a lot. As it is installed in my homedir, the units dir have been found in $(HOME)/fpc-2.2.0/lib/fpc/2.2.0/units/i386-linux/ The dir could not be picked up by mouse click neither cut/pasted in the fpc IDE, so I mispelled it a bit before having it right. Oh, finally I've edited fp.cfg while fp was off... I had to remove once more all the .ppu's and .o's before fpc ran, as you suggested.

Now gavrasm runs : thanks again.

-- Antonin

Thanks a lot. As it is installed in my homedir, the units dir have been found in $(HOME)/fpc-2.2.0/lib/fpc/2.2.0/units/i386-linux/ The dir could not be picked up by mouse click neither cut/pasted in the fpc IDE, so I mispelled it a bit before having it right. Oh, finally I've edited fp.cfg while fp was off... I had to remove once more all the .ppu's and .o's before fpc ran, as you suggested. Now gavrasm runs : thanks again.

IIRC the problem is that for textmode-apps-in-terminals you can either allow cut and pasting by mouse, or use the mouse to drive the menues. The IDE choose the latter iirc.

On Oct 26, 5:43 pm, "Antonin.de.jardin"

[apologises for possibly wrong english] Hi, there I've installed FreePascal 2.2.0 in my linux home, and I have fp in my PATH. I wish to run gavrasm, an assembler program for AVR microcontrollers (http://www.avr-asm-tutorial.net/gavrasm/index_de.html), but I can't make it to be compiled. Whenever I lauch fp within gavrasm top source tree or within freepascal installation dir, I've got the same error Fatal : can't find unit System used by gavrasm. Could somebody tell me what's fp exactly looking for, an how could I help it in getting it ? -- Antonin

Thanks for the link and tips. Is there a discussion group for this ? I know of AVRfreaks and the Basic and C compiler, but FreePascal use is new to me. Rick.

Thanks for the link and tips. Is there a discussion group for this ? I know of AVRfreaks and the Basic and C compiler, but FreePascal use is new to me.

http://www.freepascal.org/maillist.var

Jonas

Thanks for the link and tips. Is there a discussion group for this ? I know of AVRfreaks and the Basic and C compiler, but FreePascal use is new to me.

http://www.freepascal.org/maillist.var Jonas

I've been going through the gavrasm source. So far just the program file, matching begin..ends, indenting, commenting. Very important software, and should be maintained.

I don't know how it compiles properly, anyway. For example; some case...else statements seem to use improper syntax. The concluding else part is followed by multiple statements without the begin..end blocking. This is different from fpc and tp railroad diagrams.

Also, I don't know why the crt unit is used, especially on linux. Same with the sysutils unit.

That being said, very important software. Pascal really shines for text processing.

Loading...