BDS App won't compile when I added TMyConnection

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
wford23
Posts: 3
Joined: Wed 21 Feb 2007 12:50

BDS App won't compile when I added TMyConnection

Post by wford23 » Wed 21 Feb 2007 13:04

I am trying to add database functionality to one of my existing applications. When I added the TMyConnection to one of my forms and tried to compile, I get the following errors:
[C++ Error] Zlib.hpp(277): E2189 extern variable cannot be initialized
[C++ Error] Zlib.hpp(277): E2108 Improper use of typedef 'TZStreamRec'
[C++ Error] Zlib.hpp(277): E2451 Undefined symbol 'strm'
[C++ Error] Zlib.hpp(277): E2293 ) expected
[C++ Error] Zlib.hpp(282): E2189 extern variable cannot be initialized
[C++ Error] Zlib.hpp(282): E2108 Improper use of typedef 'TZStreamRec'
[C++ Error] Zlib.hpp(282): E2293 ) expected
[C++ Error] Crxml.hpp(202): E2040 Declaration terminated incorrectly

I had no problem getting the MyDAC components to work in a new application.

I am using BDS version:
Borland® Developer Studio for Microsoft® Windows™ Version 10.0.2166.28377 Update 1 Copyright © 2005 Borland® Software Corporation. All Rights Reserved.

Win2K version:
build 2195, SP4

MyDAC version:
5.0

Any suggestions? I have to get this working to purchase.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 21 Feb 2007 14:00

MyDAC for the Delphi 7 IDE and higher uses ZLib files that comes with the IDE.
Possible reason of the problem is that any other third-party component set has installed one more copy of ZLib files. Try to comment (rename) path to these files.

wford23
Posts: 3
Joined: Wed 21 Feb 2007 12:50

Post by wford23 » Wed 21 Feb 2007 14:28

I searched my entire drive, there is only one copy of ZLib.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 21 Feb 2007 15:11

I could not reproduce the problem. Please send me (evgeniyd*crlab*com) a simple project that is not compilable in your environment.

wford23
Posts: 3
Joined: Wed 21 Feb 2007 12:50

Post by wford23 » Thu 22 Feb 2007 14:52

The problem is actually being caused by the use of the ostream function "flush" in the declaration of the deflate and inflate functions defined in ZLib.hpp:

extern PACKAGE int __fastcall inflate(TZStreamRec &strm, int flush);
extern PACKAGE int __fastcall deflate(TZStreamRec &strm, int flush);

I don't understand why 'flush' would refer to the ostream function here, since the entire ZLip.hpp file is enclosed in a namespace block.

The second problem is the use of EOF (defined in stdio.h I think) in the file CRXml.hpp line 202:
__property bool EOF = {read=FEof, nodefault};

This file is also enclosed in a namespace. Can anyone explain what is going on here and how to fix it?

Thanks!

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Thu 22 Feb 2007 15:12

Sometimes our users report us about similar problems. As a rule the reason of such problems is a third-party component set that installs one more copy of ZLib.
It's hard to determine the reason of the problem you have encountered if we do not have an example.

Post Reply