Page 1 of 1

DCAL for Delphi

PostPosted: Tue Jun 20, 2017 6:04 pm
by dhs
Just tried to look at DCAL for Delphi for the first time.
Tried to compile the sample HelloWorld project. Initially got an invalid output path, but once I fixed that up am now getting the following error when I try to build it:

[dcc32 Error] UInterfaces.pas(42): E2029 'UNIT' expected but 'LIBRARY' found

Probably a pretty basic error, but I haven't used Delphi for about 15 years and am not sure what I am doing wrong. Can somebody point me in the right direction?
I am using the free version of Delphi 10.2.

Thanks,
David H.

Re: DCAL for Delphi

PostPosted: Fri Jun 23, 2017 8:49 am
by Mark F. Madura
Hello David,

What are the paths set to in your uses clause?
Code: Select all  //DCAL for Delphi Header Files
  UConstants in '../../Header Files/UConstants.pas',
  UInterfaces in '../../Header Files/UInterfaces.pas',
  UInterfacesRecords in '../../Header Files/UInterfacesRecords.pas',
  URecords in '../../Header Files/URecords.pas',
  UVariables in '../../Header Files/UVariables.pas';

Make sure these paths are valid.

MFM

Re: DCAL for Delphi

PostPosted: Fri Jun 23, 2017 9:00 am
by Mark F. Madura
In UInterfaces, I think you'll also need to change the following in the uses clause:

- Graphics should be Vcl.Graphics
- Windows should be Winapi.Windows

Re: DCAL for Delphi

PostPosted: Fri Jun 23, 2017 4:11 pm
by dhs
Thanks Mark.

The paths to these all looked ok, so I don't think that was the problem.
So I deleted my dcal for Delphi directory and re-installed it. I don't know what was wrong the first time (presumably I must have touched some other file when fixing up the out put path), but I have managed to get it to build (subject to a couple of things I need to to fix up - see below). I will look at it further when I get a chance.

I had to fix up my output path again. The installed files are pointing to a DataCAD 16 folder which I do not have. If I could make a suggestion, it would be nice if the DataCAD install did a replace on the paths in the sample files based on the installation directory. I was able to use a tool to do a global replace based on my directory and it appears to be all working ok, so I don't see why the install can't do something similar. The replace I did is shown below (based on my paths):

Image

I also got an error "[dcc32 Fatal Error] UInterfaces.pas(5): F2613 Unit 'Graphics' not found." when I first tried to build it after fixing up the output path. I was able to fix this by adding vcl namespace prefix as shown below, but you might like to check as to why this is required but is not in your sample file (has there been a change to Delphi since the samples were created?).

Image


Regards,
David

Re: DCAL for Delphi

PostPosted: Fri Jun 23, 2017 4:16 pm
by dhs
... just noticed your second post. Obviously you're already aware of the need to add the vcl namespace ... !

Re: DCAL for Delphi

PostPosted: Mon Jun 26, 2017 9:12 am
by Mark F. Madura
FWIW,

You can also define the namespaces in the project options.
- Project Options > Delphi Compiler > Unit scope names

MFM