Gustavo Carreno - 2014-11-07

Hi there,

I'm using Lazarus 1.2.6, FPC 2.6.4, Ubuntu 14.10 64bits.
SVN Revision: r328

I was able to compile version 6.9.1 with no folder issues, since all the code is inside 1 folder and Lazarus/FPC was (to my utter surprise) even leniant with Capitalized filenames. I wasn't able to install and run a demo prog, because of ppu issues with my Ubuntu fcl-db package. Lazarus is complaining about some ppu dependencies, when re-compiling Lazarus itself with ver 6.9.1. I remove the package, re-compile, and all is well. So I need to do some rather deep digging into this.

When I try to compile the trunk version on the SVN repo, I begin falling down a rabbit hole :)

(If the person in charge of the code, prefers this post to be broken down into Issues on the Issue Tracker, please don't hesitate to say it :)

So let's start:

  • This appears in the Other Units Filepath of both "packages/Lazarus/tdbf_l.lpk" and "packages/Lazarus/tdbf_ld.lpk": "$(LazarusDir)/ideintf/units/$(TargetCPU)/$(TargetOS)/". This path, I think, is a bit outdated, since I can't find it under my Lazarus install. It should be replaced by "../../src", which makes a lot more sense with the current folder structure.

  • Package "packages/Lazarus/tdbf_l.lpk" should have the file "Dbf.pas" removed and add "../../src/dbf.pas" to replace it.

  • Package "packages/Lazarus/tdbf_ld.lpk" should have the following:

    1. File "Dbf_Reg.pas" removed and replaced by "../../src/dbf_reg.pas".
    2. A dependency of IDEIntf should be added to the required Packages, since "dbf_reg.pas" uses PropEdits.
  • Due to Ansi considerations, the author decided to add some String Copy/Compare/etc functions under "dbf_ansistrings.pas". The problem arises because of the following:

    1. "dbf.pas" uses "dbf_common.pas".
    2. "dbf_common.pas" uses "dbf_wtil.pas".
    3. "dbf_wtil.pas" calls dbfStr* functions that are defined under "dbf_ansistrings.pas", which at this point is not visible to the compiler.
  • Adding dbf_ansistrings under the Implementation uses clause of "dbf_wtil.pas" gets us into another problem:

    1. This time it's many compiler errors complaining about the dbfStr* functions:
    2. /home/gcarreno/Dropbox/LazComponents/tDBF-6.9.x/src/dbf_ansistrings.pas(80,31) Error: Incompatible types: got "strlen(PChar):Int64;" expected "<procedure variable="" type="" of="" function(const="" PChar):DWord;Register="">"
    3. That error is for this line's content: dbfStrLen := SysUtils.StrLen;
  • Tried a very dirty and possibly wrong hack, adding @ before the one's that had errors, thus turning:

    1. dbfStrLen := SysUtils.StrLen; into
    2. dbfStrLen := @SysUtils.StrLen;
    3. Did the job of removing errors from that file.
    4. I'm now stuck at something else, but it has to do with fpc binary(.ppu) files under the fcl-db package, which I don't want to mess since it's from the Ubuntu repo.

Ufffff. Big one :D

Hope this helps in any way. I'm subscribing to this post so I get alerts. Anything more, you folk need from me, please ask.

Cheers,
Gus