* * *

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

swierzbicki

  • Full Member
  • ***
  • Posts: 175
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: 4412
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 »
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5639
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.

 

Recent

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