Compiling TeeChart 2020 for Delphi 2007

We recently bought TeeChart 2020.30 VCL/FMX with full source code (of course) and I now tried to install it.

Steema provides a “TeeChart Source Code Recompilation Tool” (TeeRecompile.exe) that supposedly does this for you. This is fine if it works, it’s a pain in the lower back if it doesn’t. It worked fine for Delphi XE2 and 10.x but it failed for Delphi 2007 with the error “[DCC Error] DclTeePro911.dpk(39): E2202 Required package ‘IndyProtocols’ not found“.

There the pain began:

I had removed the ancient Indy10 version that was shipped with Delphi 2007 from my installation and deleted all the files. Instead I have downloaded the latest sources (OK, not the latest, the dowload was on 2020-03-20), but never bothered to compile the packages since we don’t use packages, not even the runtime packages.

So I looked for the Delphi 2007 package projects. There are 3 of them:
IndySystem110.dpk, IndyCore110.dpk and IndyProtocols110.dpk (I didn’t bother with the designtime packages.). There is also a batch file Fulld_2007.bat which supposedly builds them for you. Unfortunately it doesn’t work. There were multiple “The system cannot find the file specified.” errors. Of course it didn’t tell me which files were missing, so I added “Echo on” to the batch file to find out. It turned out to be the *110.bpl and *110.dcp files it could not find when it tried to copy them to the D11 subdirectory. Since it tries to copy them from the current directory which happened to be the Indy10\lib directory, that’s small wonder: By default bpl and dcp files are created in the Package and DCP output directories which are configured in the IDE (Tools -> Options -> Environment Options -> Delphi Options -> -> Library – Win32). These default to $(BDSCOMMONDIR)\Bpl and $(BDSCOMMONDIR)\dcp respectively. And since the developers didn’t specify a custom output directory for these projects that’s where the files went.

OK, rather than bothering with the batch file, I loaded the three package projects into the IDE, set a dcu output directory so the source doesn’t get cluttered with the dcus, and built them. That worked fine, problem solved… No, unfortunately not. When I tried the TeeChart compilation tool again, it still complained about the IndyProtocols package.

The reason is simple: The Indy Delphi 2007 package projects have a hard coded 110 suffix e.g. IndyProtocols110.dpk. The standard would have leave out that suffix e.g. IndyProtocols.dpk and configure a libsuffix (Project -> Options -> Description). This then creates IndyProtocols.dcp and IndyProtocols110.bpl. TeeChart is looking for IndyProtocols.dcp and can’t find it.

Easy to fix: Load the DclTeePro911.dpk package into the IDE, remove the requires entry for IndyProtocols and add IndyProtocols110 instead. After this change the package comiled fine in the IDE, problem solved… No, still not. The Teechart compilation tool still complained, now it didn’t find the IndyProtocols110 package. WTF? I just created it and I checked that it is where it is supposed to be: In the default DCP output directory.

Fortunately the tool also allows to output verbose messages which also writes the dcc32 calls into the log:

"c:\delphi\2007\bin\dcc32.exe"  -$D- -$L- -$W- -$O+ -$C- -$Y- -$C- -$R- -$Q-  -W+ -H  -$A8  --no-config -u"c:\delphi\2007\Lib" -u"c:\delphi\2007\Lib\Indy10" -LN"D:\Source\TeeChartPro_2020.30\Source\..\Compiled\Delphi11\Lib" -E"D:\Source\TeeChartPro_2020.30\Source\..\Compiled\Delphi11\bin" -N0"D:\Source\TeeChartPro_2020.30\Source\..\Compiled\Delphi11\Lib" -U"D:\Source\TeeChartPro_2020.30\Source\..\Compiled\Delphi11\Lib";"c:\delphi\2007\Lib";"D:\Source\TeeChartPro_2020.30\Source" -I"D:\Source\TeeChartPro_2020.30\Source" -R"D:\Source\TeeChartPro_2020.30\Source" -O"c:\delphi\2007\Lib" -M  "D:\Source\TeeChartPro_2020.30\Source\TeeImport911.dpk" -LE"D:\Source\TeeChartPro_2020.30\Source\..\Compiled\Delphi11\System"

After stupidly looking at this monster for several minutes I noticed the -u”c:\delphi\2007\Lib\Indy10″ option. Could it be that it looks for the Indy packages in that directory only? (My Delphi 2007 is installed to “c:\delphi\2007” rather than c:\program files\codegear\[whatever].)

So I copied the Indy dcp files from $(BDSCOMMONDIR)\dcp to this directory and tried again. Diesmal funktioniert alles! (This time everything works.)

Did I mention that I hate “helpful compilation tools” ? I guess I can’t really blame Steema for this (hardcoding the dcp search path is kind of – ahem – not quite a good idea though). But those indy guys seem to be kind of sloppy. You don’t really hard code the package suffixes into the project file names! That was only necessary until Delphi 5.

But hey, they are volunteers and Indy is free, so I guess you get what you pay for. 😉

On the other hand: Guess who has hard coded project suffixes too? TeeChart does: 911 for Delphi 2007 which means TeeChart version 9 for Delphi 11. That’s not even the standard suffix which would have been 110.

Standards are great! Everyone should have one of his own!
— attributed to Bob Metcalfe, Co-inventor of Ethernet