Results 1 to 3 of 3

Thread: Compile by command line using IDE configuration

  1. #1

    Question Compile by command line using IDE configuration

    I'm trying to compile a unit, which use some LCL units. The compilation through the IDE works, but the compilation dosen't work by command line.

    - First I realized that using the command line "FPC <Unit>" will compile in Release Mode. The Release Mode was asking for the location of the Interfaces unit. In the IDE, the compilation in the Release Mode also works fine.

    - I tryed to copy the content of the fp.cfg, the configuration file used by the IDE, and I pasted it in the fpc.cfg file, the configuration file used by the compiler(in command line). But nothing changed, in command line, the output is that the compiler can't find the Interfaces unit, even after the copy of the configuration from fp.cfg content to fpc.cfg the configuration of the IDE pasted.

  2. #2
    To know all Free Pascal command line options run "fpc -help" from console.

    There are a lot of them. The one that tells where units are is "-Fu<dir>". For example, for my Ubuntu/Linux the Lazarus Component Library (LCL) is at "-Fu/usr/lib/lazarus/0.9.30/lcl/*". Note the "*" at the end that means it should look at the subdirectories.

    Also remember to tell the compiler it needs to use Object Pascal instead of Pascal by using "-Mobjfpc".
    Last edited by Ñuño Martínez; 27-03-2012 at 10:29 AM.
    No signature provided yet.

  3. #3
    Thank you very much! That is what I was looking for!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •