I like to keep my IDE installations as "out-of-the-box" as possible. This means that it is not an option to install the binary and/or the source code to the IDE.
Until now I have done this by creating all components of other libraries (that can also be installed to the IDE) at run-time, and this worked well. With this, I can keep the source code of all libraries in our version control, so that if I need to change anything, these changes are also preserved. With TeeChart however I cannot get this to work.
As a test setup, I did the following:
- I have run the installer for the source code, so that it extracts the source code to disk. I did not run the recompile tool to add it to the IDE.
- I copied the source code folder to a different location and used the uninstaller to remove the original source code installation.
- I started a new Delphi VCL Forms project in the folder to which I copied the TeeChart sources (TeeChart sources are located in a subfolder)
- I added the TeeChart sources subfolder to the project search path
- I added the "Chart" unit to the uses section
- I put the following code in the FormCreate event handler:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject); var lChart: TChart; begin lChart := TChart.Create(self); lChart.Parent := Self; end;
- When compiling the following errors appear:
Code: Select all
[dcc32 Error] TeCanvas.pas(5692): E2010 Incompatible types: 'VCLTee.TeCanvas.TTeeCanvas' and 'TeCanvas.TTeeCanvas' [dcc32 Error] TeCanvas.pas(8496): E2010 Incompatible types: 'TTeeCanvas' and 'TTeeCanvas3D' [dcc32 Fatal Error] TeeProcs.pas(662): F2063 Could not compile used unit 'TeCanvas.pas'
Code: Select all
3099 {$IFDEF FMX}
3100 FMXTee.Html, FMXTee.Constants
3101 {$ELSE}
3102 {$IFDEF D16}
3103 VCLTee.TeeHtml, VCLTee.TeeConst
3104 {$ELSE}
3105 TeeHtml, TeeConst
3106 {$ENDIF}
3107 {$ENDIF}
Now because I did not install the source code to the IDE, Delphi is using the shipped version of TeeChart Lite for all the units that carry the VCLTee prefix.
Is there an easy way to keep Delphi from thinking that it can use the Lite version for the VCLTee scoped units? Or can I make it so that the unscoped units are used throughout the Teechart source code?
Preferably I can do this with a simple compiler directive, so that it is portable beyond IDE settings (including to the command line compiler)
The unpreffered (and untested) alternative would probably be to remove these conditionals and only keep the unscoped unit names, and do this in all the source files. As this is a lot of work and makes upgrading to a new version in the future a lot harder, I would like to avoid solving it like this.