Compilation problems [D7]

The offical for ZeosLib 7.3 Report problems, ask for help, post proposals for the new version of Zeoslib 7.3/v8
Quick Info:
-We made two new drivers: odbc(raw and unicode version) and oledb
-GUID domain/field-defined support for FB
-extended error infos of Firebird
-performance ups are still in queue
In future some more feature will arrive, so stay tuned and don't hassitate to help
Post Reply
Bodenseematze
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 18.12.2023, 11:48

Compilation problems [D7]

Post by Bodenseematze »

Hello together,

I want to test ZeosLib for usage with ODBC - so I checked out the master version with GIT and tried to compile it for my (very old) Delphi 7 Enterprise.

But the compilation failed - regardless what I do.

First I tried to compile it without any changes to Zeos.inc
ZCore did compile,

ZDbc complains:

Code: Select all

[Error] ZDbcLogging.pas(79): Undeclared identifier: 'SQLString'
[Error] ZDbcIntfs.pas(112): Undeclared identifier: 'TZClientFormatSettings'
[Error] ZDbcIntfs.pas(754): Undeclared identifier: 'UnicodeString'
[Error] ZDbcIntfs.pas(1433): Undeclared identifier: 'IZIdentifierConverter'
[Error] ZDbcIntfs.pas(2215): Undeclared identifier: 'TZDate'
[Error] ZDbcIntfs.pas(2232): Undeclared identifier: 'TZTime'
[Error] ZDbcIntfs.pas(2249): Undeclared identifier: 'TZTimeStamp'
[Fatal Error] ZDbcIntfs.pas(4473): Could not compile used unit '..\..\src\dbc\ZDbcProperties.pas'
ZParseSql complains:

Code: Select all

[Error] ZGenericSqlToken.pas(72): Declaration of 'NextToken' differs from previous declaration
  [Error] ZGenericSqlToken.pas(97): Declaration of 'NextToken' differs from previous declaration
  [Error] ZGenericSqlToken.pas(108): Declaration of 'NextToken' differs from previous declaration
  [Error] ZGenericSqlToken.pas(111): Method 'DecodeToken' not found in base class
  [Error] ZGenericSqlToken.pas(125): Declaration of 'NextToken' differs from previous declaration
  [Error] ZGenericSqlToken.pas(128): Method 'DecodeToken' not found in base class
  [Error] ZGenericSqlToken.pas(136): Declaration of 'NextToken' differs from previous declaration
  [Error] ZGenericSqlToken.pas(158): Undeclared identifier: 'ReadDecDigits'
  [Error] ZGenericSqlToken.pas(170): Undeclared identifier: 'P'
  [Error] ZGenericSqlToken.pas(175): Undeclared identifier: 'ReadDecDigits'
  [Error] ZGenericSqlToken.pas(198): Undeclared identifier: 'P'
  [Error] ZGenericSqlToken.pas(198): Operator not applicable to this operand type
  [Error] ZGenericSqlToken.pas(199): Operator not applicable to this operand type
  [Error] ZGenericSqlToken.pas(202): Undeclared identifier: 'ReadHexDigits'
  [Error] ZGenericSqlToken.pas(208): Undeclared identifier: 'P'
  [Error] ZGenericSqlToken.pas(210): Incompatible types: 'TStream' and 'PAnsiChar'
  [Error] ZGenericSqlToken.pas(212): Undeclared identifier: 'L'
  [Error] ZGenericSqlToken.pas(212): Undeclared identifier: 'P'
  [Error] ZGenericSqlToken.pas(284): Incompatible types: 'TStream' and 'PAnsiChar'
  [Error] ZGenericSqlToken.pas(286): Undeclared identifier: 'L'
  [Error] ZGenericSqlToken.pas(287): Undeclared identifier: 'P'
  [Error] ZGenericSqlToken.pas(287): Undeclared identifier: 'L'
  [Error] ZGenericSqlToken.pas(302): Undeclared identifier: 'P'
  [Error] ZGenericSqlToken.pas(313): Undeclared identifier: 'P'
  [Error] ZGenericSqlToken.pas(313): Undeclared identifier: 'P'
  [Error] ZGenericSqlToken.pas(323): Undeclared identifier: 'P'
  [Error] ZGenericSqlToken.pas(324): Operator not applicable to this operand type
  [Error] ZGenericSqlToken.pas(331): Undeclared identifier: 'L'
  [Error] ZGenericSqlToken.pas(331): Undeclared identifier: 'P'
  [Error] ZGenericSqlToken.pas(336): Undeclared identifier: 'P'
  [Error] ZGenericSqlToken.pas(345): Undeclared identifier: 'P'
  [Error] ZGenericSqlToken.pas(354): Undeclared identifier: 'P'
  [Error] ZGenericSqlToken.pas(370): Undeclared identifier: 'L'
  [Error] ZGenericSqlToken.pas(371): Undeclared identifier: 'P'
  [Error] ZGenericSqlToken.pas(371): Operator not applicable to this operand type
  [Error] ZGenericSqlToken.pas(371): Undeclared identifier: 'P'
  [Error] ZGenericSqlToken.pas(371): Pointer type required
  [Error] ZGenericSqlToken.pas(371): Type of expression must be BOOLEAN
  [Error] ZGenericSqlToken.pas(372): Undeclared identifier: 'L'
  [Warning] ZGenericSqlToken.pas(373): Comparing signed and unsigned types - widened both operands
  [Error] ZGenericSqlToken.pas(373): Undeclared identifier: 'P'
  [Error] ZGenericSqlToken.pas(373): There is no overloaded version of 'SQLDequotedStr' that can be called with these arguments
  [Error] ZGenericSqlToken.pas(375): Undeclared identifier: 'P'
ZPlain complains:

Code: Select all

[Error] ZPlainDbLibDriver.pas(1151): Undeclared identifier: 'TZCustomElementList'
  [Error] ZPlainDbLibDriver.pas(1151): Class type required
  [Error] ZPlainDbLibDriver.pas(1160): Method 'Notify' not found in base class
  [Error] ZPlainDbLibDriver.pas(1165): Class type required
  [Error] ZPlainDbLibDriver.pas(1174): Method 'Notify' not found in base class
  [Error] ZPlainDbLibDriver.pas(1778): Undeclared identifier: 'Add'
  [Error] ZPlainDbLibDriver.pas(1803): Undeclared identifier: 'Add'
  [Error] ZPlainDbLibDriver.pas(1830): Undeclared identifier: 'Add'
  [Error] ZPlainDbLibDriver.pas(1854): Undeclared identifier: 'Add'
  [Error] ZPlainDbLibDriver.pas(1881): Undeclared identifier: 'Add'
  [Error] ZPlainDbLibDriver.pas(1905): Undeclared identifier: 'Add'
  [Error] ZPlainDbLibDriver.pas(1962): Undeclared identifier: 'Count'
  [Error] ZPlainDbLibDriver.pas(1963): Class does not have a default property
  [Error] ZPlainDbLibDriver.pas(1964): Undeclared identifier: 'Add'
  [Error] ZPlainDbLibDriver.pas(1965): Class does not have a default property
  [Error] ZPlainDbLibDriver.pas(1968): Undeclared identifier: 'Delete'
  [Error] ZPlainDbLibDriver.pas(1970): Undeclared identifier: 'Count'
  [Error] ZPlainDbLibDriver.pas(1971): Class does not have a default property
  [Error] ZPlainDbLibDriver.pas(1972): Undeclared identifier: 'Add'
  [Error] ZPlainDbLibDriver.pas(1973): Class does not have a default property
  [Error] ZPlainDbLibDriver.pas(1976): Undeclared identifier: 'Delete'
  [Error] ZPlainDbLibDriver.pas(3418): Too many actual parameters
  [Error] ZPlainDbLibDriver.pas(3418): Too many actual parameters
  [Error] ZPlainDbLibDriver.pas(3433): Too many actual parameters
  [Error] ZPlainDbLibDriver.pas(3433): Too many actual parameters
  [Fatal Error] ZPlain.dpk(51): Could not compile used unit '..\..\src\plain\ZPlainDbLibDriver.pas'
ZComponentDesign did not - it complains:

Code: Select all

[Fatal Error] ZPropertyEditor.pas(239): File not found: 'ZDbcODBCUtils.dcu'
(the other packages also show errors...)

Then I tried to only compile what I need and changed src/Zeos.inc:

Code: Select all

// Uncomment these defines to disable some DB drivers (reduce binary size)
{$DEFINE ZEOS_DISABLE_MYSQL}
{$DEFINE ZEOS_DISABLE_POSTGRESQL}
{.$DEFINE ZEOS_DISABLE_DBLIB}
{$DEFINE ZEOS_DISABLE_ADO}
{$DEFINE ZEOS_DISABLE_INTERBASE}
{$DEFINE ZEOS_DISABLE_FIREBIRD}
{$DEFINE ZEOS_DISABLE_SQLITE}
{$DEFINE ZEOS_DISABLE_ORACLE}
{$DEFINE ZEOS_DISABLE_ASA}
{$DEFINE ZEOS_DISABLE_SQLANY}
{$DEFINE ZEOS_DISABLE_POOLED}
{$DEFINE ZEOS_DISABLE_OLEDB}
{.$DEFINE ZEOS_DISABLE_ODBC}
{$DEFINE ZEOS_DISABLE_PROXY}
But the errors are still the same - so my question is, if someone else successfully managed to compile it for Delphi 7?
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1918
Joined: 17.01.2011, 14:17

Re: Compilation problems [D7]

Post by marsupilami »

Hello bodenseematze,

the following worked for me some minutes ago on Delphi 7 Professional:
  • make sure that only the path to Zeos-trunk\packages\delphi7\build is in the library path.
  • make sure that no old compiled zeos units (Z*.dcu) or old Zeos files (*.pas) can be found by Delphi - even in the directory where you checked out Zeos Trunk
  • Go to "C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl", and delete any BPL and DCU files starting with ZCore, ZParseSQL, ZPlain, ZDbc, ZComponent and ZComponentDesign
  • open the ZeosDbo.bpg file in packages\delphi7
  • compile projects in the following order: ZCore, ZParseSQL, ZPlain, ZDbc, ZComponent, ZComponentDesign
  • install ZComponentDesign
This worked for me. From a source code perspective Zeos Trunk compiles with Delphi 7. If Delphi stops compiling with an Access Violation or internal compiler errors, make sure, you have nothing old around.

But if you think about new projects please don't use Delphi 7 anymore. Please think about using Lazarus and FreePascal in that case or use a newer Delphi, that is at least Unicode enabled. Or maybe you can use the Delphi Community Edition?
Staying compatible to these old Delphi versions is getting increasingly hard to do. I am pretty sure that for one of the upcoming releases of Zeos we will drop support for ANSI Delphis (Delphi 7, Delphi 2007).

Best regards,

Jan
Post Reply