* * *

Author Topic: How can I recompile a modified fpc unit ?  (Read 1864 times)


  • Full Member
  • ***
  • Posts: 177
How can I recompile a modified fpc unit ?
« on: July 13, 2016, 01:50:24 pm »

I've modified C:\lazarus\fpc\3.0.0\source\packages\fcl-json\fpjsonrtti.pp so that TJSONDeStreamer supports custom date time formats.
My issue is that new properties are not recognized by the IDE. What am I missing ?
Lazarus 1.6.2
fpc 3.0.0
delphi berlin


  • Hero Member
  • *****
  • Posts: 6131
Re: How can I recompile a modified fpc unit ?
« Reply #1 on: July 13, 2016, 02:14:50 pm »
Make sure your sourcecode (-Fu) is in the path and before the compiled unit directories.
Make sure you specify -B  when compiling.

Make also sure you only point to the sourcecode you specifically changed.
« Last Edit: July 13, 2016, 02:16:31 pm by Thaddy »
I might not give the answer that you want me to.. Peter Green 1969


  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6242
Re: How can I recompile a modified fpc unit ?
« Reply #2 on: July 13, 2016, 02:19:46 pm »
If the fpjsonrtti is a leaf unit (not used by anything else in the FPC (and/or Lazarus in the case of Lazarus) tree:

- compile the units in some directory.
- find the units directory e.g. (fpc/units/i386_win32) and replace the fpjsonrtti.o|ppu with the one generated from the new compile.

If it is not a leaf procedure, put the source in the FPC source dir and rebuild the whole of FPC and Lazarus.

While the quick fix solutions that Thaddy proposes can work, it leads to precompiled copies of units in random places, and this can lead to confusing errors later.

I always try to avoid situations where I have multiple .o/.ppu or sources in the path, and that seriously decreases the number of "strange" problems.



Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus