Recent

Author Topic: Can't find unit Crt  (Read 33188 times)

janred

  • Newbie
  • Posts: 5
Can't find unit Crt
« on: June 10, 2016, 05:04:51 am »
I have been using Free Pascal 2.6.4 for quite a while but when I upgraded to 3.0.0, it will not compile programs that Use the Crt Unit which run fine on the earlier version. Any suggestions?

bee

  • Sr. Member
  • ****
  • Posts: 393
Re: Can't find unit Crt
« Reply #1 on: June 10, 2016, 05:31:50 am »
What's the error message? I can confirm that FPC 3.0.0 is still able to compile a program that uses the CRT unit just fine. I've tried it myself on a Linux box.
-Bee-

A long time pascal lover.

balazsszekely

  • Guest
Re: Can't find unit Crt
« Reply #2 on: June 10, 2016, 06:06:37 am »
It works on windows too(just tested).

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Can't find unit Crt
« Reply #3 on: June 10, 2016, 06:27:52 am »
Any suggestions?
Describe "will not compile" as precise as possible, we're not oracles and that phrase could have 10 meanings or so.

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: Can't find unit Crt
« Reply #4 on: June 10, 2016, 08:48:56 am »
The only thing I can think of is that the compiler is not in the path.
Note, not the crt unit, no, the compiler binary, i.e. fpc and ppc386 and or ppcx64
Add the path...

Oh, I can think of another: old fpc.cfg. Open the fpc.cfg and look if there are any paths in it and that the paths are correct for 3.0, not 2.6.4.
Specialize a type, not a var.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Can't find unit Crt
« Reply #5 on: June 10, 2016, 11:48:31 am »
Sounds like an unit path problem, either in the fpc.cfg (commandline use, lazarus) or configuration (textmode IDE)


janred

  • Newbie
  • Posts: 5
Re: Can't find unit Crt
« Reply #6 on: August 18, 2016, 02:24:02 am »
Sorry I haven't been able to get back to this but Free Pascal 3.0.0 still isn't recognising the Crt Unit. Its fine with Maths and SysUtils. Using Windows 7.

Have checked the fpc.cfg and the paths seem fine but (sorry) not sure how to change/check the path to the compiler. Don't seem to have ppcx64 but do have ppc386.exe

The message is Fatal: Can't find unit Crt used by ...

I have just had my drive reimaged and reinstalled both 2.6.4 and 3.0.0 but stuck with the same issue.


molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Can't find unit Crt
« Reply #7 on: August 18, 2016, 05:23:56 am »
Instead of keeping yourself and helpers in the dark, compile the project that generates this error for you with the compiler option -va and post the output to your next post.

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Can't find unit Crt
« Reply #8 on: August 18, 2016, 06:14:19 am »
Some weeks ago, I failed to make CRT unit to work on my Ubuntu Mate 64 bit Lazarus 1.6 FPC 3.0.0 pc. I found an old laptop and installed the latest version of Lazarus/FPC, and it works on WinXP on the first attempt.

janred

  • Newbie
  • Posts: 5
Re: Can't find unit Crt
« Reply #9 on: August 26, 2016, 02:48:04 am »
I have attached a screen shot of the error message I am getting along with the same program compiled using 2.6.4. I am not using Lazarus and I get this on two different computers, both running Windows 7.
« Last Edit: August 26, 2016, 03:00:03 am by janred »

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Can't find unit Crt
« Reply #10 on: August 26, 2016, 03:32:20 am »
@janred:
You don't have your unit path set-up correctly, hence the question to view all messages (-va option) so that we/you can read that.

Note that every mode (debug, normal, release) has it's own individual unit directory settings.

To whom it may concern:
* molly kicks those that still believe in the fairy-tales from MS that using appdata for storing program settings is the way things should be done. And no, repeatedly automatically reverting to that location without user consent is not the way to go.

janred

  • Newbie
  • Posts: 5
Re: Can't find unit Crt
« Reply #11 on: August 26, 2016, 03:59:07 am »
Okay, thanks. I have looked in the fpc.cfg file and all paths seem to point to 3.0.0. I am assuming that this would be the relevant section:

# searchpath for units and other system dependent things
-FuC:\FPC\3.0.0/units/$fpctarget
-FuC:\FPC\3.0.0/units/$fpctarget/*
-FuC:\FPC\3.0.0/units/$fpctarget/rtl

The crt.ppu file is in the rtl-console folder so should the last line be changed to:

-FuC:\FPC\3.0.0/units/$fpctarget/rtl-console?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Can't find unit Crt
« Reply #12 on: August 26, 2016, 04:09:33 am »
Okay, thanks. I have looked in the fpc.cfg file and all paths seem to point to 3.0.0. I am assuming that this would be the relevant section:

# searchpath for units and other system dependent things
-FuC:\FPC\3.0.0/units/$fpctarget
-FuC:\FPC\3.0.0/units/$fpctarget/*
-FuC:\FPC\3.0.0/units/$fpctarget/rtl

The crt.ppu file is in the rtl-console folder so should the last line be changed to:

-FuC:\FPC\3.0.0/units/$fpctarget/rtl-console?
The text mode IDE has embedded compiler and it doesn't read fpc.cfg, it has its own fp.cfg which you can configure in the IDE through the Options menu. This includes unit, include and library directory.

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Can't find unit Crt
« Reply #13 on: August 26, 2016, 04:12:04 am »
Quote
I have looked in the fpc.cfg file and all paths seem to point to 3.0.0.
fp-ide uses fp.cfg, not fpc.cfg (as Leledumbo also stated).

- start fp-ide
- select your 'compilation mode'
- Option/Directories
- Tab Units

Should (at the least) read for you:
C:\FPC\3.0.0\units\$FPCTARGET\*

The option:
- Option\Compiler
- tab Verbose
- checkmark item ALL

And compile, will show you a very comprehensive output in the compiler message window and show you why it cannot find unit CRT. e.g. all the paths it attempts to try will be listed there (yes, a very long list with also other output but, worth exploring in case things fail).

janred

  • Newbie
  • Posts: 5
Re: Can't find unit Crt
« Reply #14 on: August 26, 2016, 04:42:14 am »
Okay, thanks. That helped a lot. I copied and pasted the crt.ppu and crt.o into the rtl and folder and it is now working!

 

TinyPortal © 2005-2018