Recent

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

swierzbicki

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

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
wince/win32/win64
delphi berlin

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
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 »
Specialize a type, not a var.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
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.

 

TinyPortal © 2005-2018