Recent

Author Topic: Two FPC Issues  (Read 3983 times)

stansbkg

  • New Member
  • *
  • Posts: 28
Two FPC Issues
« on: February 23, 2017, 09:14:42 pm »
A week ago, FPC 3.0.0 stopped displaying detailed compile error messages, just "compilation failed." I was unable to change that.

So, downloaded
FPC 3.0.2, which does give the detailed messages. However, some previously functioning programs would not work. For example, compilation fails for "uses crt"

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Two FPC Issues
« Reply #1 on: February 23, 2017, 09:16:55 pm »
Assuming you are compiling from commandline, use "fpc -va project.pas" in order to get detailed output and see what fpc.cfg your 3.0.2 installation is using as well as where it tries to search for your units/packages.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11351
  • FPC developer.
Re: Two FPC Issues
« Reply #2 on: February 23, 2017, 09:37:49 pm »
Both seem to point to faulty configuration files, fpc.cfg.

The first is the -vwih in the fpc.fg that makes the output verbose, the second is related to the -Fu in there that sets the unit search paths.

(the RTL one is auto included and for old-skool console programs the first unit outside the RTL path usually is ... crt)

You might have a stale fpc.cfg. Oops,. that is just what Molly says. Ok, just additional background then :-)

stansbkg

  • New Member
  • *
  • Posts: 28
Re: Two FPC Issues
« Reply #3 on: February 24, 2017, 03:55:09 pm »
Suggestion fixed the first problem. However, I still get the message "Cannot open include file "crth.inc" Search of the whole FPC folder cannot find a copy of "crth.inc"

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Two FPC Issues
« Reply #4 on: February 24, 2017, 09:12:35 pm »
@marcov:
Sorry, i could have been more informative. Thank you for the addition(s).

@stansbkg:
As you can see here for yourself, the file is part of 3.0.2 sources, so it should be there.

Are you sure that your include directories are setup correctly ?

edit: let me rephrase that:
What is it that you are trying to accomplish exactly ?

If you have installed 3.0.2 using the installer, and you want to _use_ the crt unit then that should be enough.

You should not receive any messages concerning include file as the units are already compiled. The only reason fpc is unable to locate those compiled units is when fpc is looking for them at the wrong location.

As marcov told, that might be because of a stale fpc.cfg that's somewhere around your system and which is picked up by your fpc 3.0.2 installation. Hence why i suggested to use the -va option as that will tell you exactly which fpc version and what fpc.cfg is used to compile your source(s). Also it will tell you which directories fpc (being told by fpc.cfg) is using to locate your units.
« Last Edit: February 24, 2017, 09:37:56 pm by molly »

 

TinyPortal © 2005-2018