Recent

Author Topic: [solved] fpc.cfg with switch -Xd  (Read 6154 times)

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
[solved] fpc.cfg with switch -Xd
« on: November 20, 2009, 01:09:38 pm »
For cross compilation I have to avoid reading from /usr/lib. It works well with "-Xd /usr/lib" at lazarus->compiler settings->additional (or however the english translation is). If I place the switch into fpc.cfg like
Code: [Select]
#ifdef x86_64
-Fl/usr/lib
#else
-Xd/usr/lib
-Fl/usr/lib32
#endif
it fails with "Error: Illegal parameter: -Xd/usr/lib". Any idea how to solve?

Linux (Ubuntu 9.04)
Lazarus 0.9.29 (r22308M)
FPC 2.5.1 (Rev 14211)
« Last Edit: November 21, 2009, 05:31:56 pm by Ocye »
Lazarus 1.7 (SVN) FPC 3.0.0

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1071
Re: fpc.cfg with switch -Xd
« Reply #1 on: November 20, 2009, 09:25:33 pm »
For cross compilation I have to avoid reading from /usr/lib. It works well with "-Xd /usr/lib" at lazarus->compiler settings->additional (or however the english translation is). If I place the switch into fpc.cfg like
Code: [Select]
#ifdef x86_64
-Fl/usr/lib
#else
-Xd/usr/lib
-Fl/usr/lib32
#endif
it fails with "Error: Illegal parameter: -Xd/usr/lib". Any idea how to solve?

I don't know why it works in the Lazarus compiler settings, but the reason that it fails on the command line is that -Xd doesn't take any additional parameters. "-Xd" by itself means "Do not use standard library search path". You don't have to and cannot specify the directories that it should not search. The standard library search paths are hardcoded in FPC, and -Xd simply tells the compiler not to search these directories.

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: fpc.cfg with switch -Xd
« Reply #2 on: November 21, 2009, 05:31:42 pm »
That was the reason! Thanks a lot. Within the compiler settings I had to apply a blank, and apparently the remaining string was ignored there and not in the cfg.
Lazarus 1.7 (SVN) FPC 3.0.0

 

TinyPortal © 2005-2018