Hello.
I have installed ZeosLib v8.0.0-beta into Embt RAD Studio XE10 and XE10.3 (Rio).
Installation of Windows package for x32 and x64 was relatively without problem.
However we have had problem if we compiled C++ Builder project which include ZeosLib components.
We got following error messages:
[bcc32c Error] ZDbcOleDBUtils.hpp(39): expected ')' ZDbcOleDBUtils.hpp(39): to match this '('
[bcc32c Error] ZDbcOleDBUtils.hpp(40): expected ')' ZDbcOleDBUtils.hpp(40): to match this '('
[bcc32c Error] ZDbcOleDBUtils.hpp(40): redefinition of 'VARIANT_BOOL' ZDbcOleDBUtils.hpp(39): previous definition is here Failed
If I have looked at ZDbcOleDBUtils.hpp I have found there following definitions:
static const short VARIANT_TRUE = short(-1); static const short VARIANT_FALSE = short(0);
These definitions collide with same definitions in header file of wtype.h from Windows SDK:
/* 0 == FALSE, -1 == TRUE */ typedef short VARIANT_BOOL; ... #define VARIANT_TRUE ((VARIANT_BOOL)-1) #define VARIANT_FALSE ((VARIANT_BOOL)0)
static const short ZVARIANT_TRUE = short(-1); static const short ZVARIANT_FALSE = short(0);
This workaround helped and now we have not problem with the C++ project.
Could you judge above described problem and correct ZeosLib code so that C++ projects will be generated without error?
Diff:
Diff:
Hello Vaclav,
the problem is that VARIANT_TRUE and VARIANT_FALSE are not defined in Delphi. I renamed the constants in OLEDB and changed the driver to use these new names. Could you please check if the change solves your problem? Unfortunately I do own a copy of C++ Builder but don't know how to compile Zeos successfully there...
I created a new ticket [#483] for the issue that it is not possible to compile the ado driver without the oledb driver.
Best regards,
Jan
Related
Bugs: #483
Hello Jan,
I have tested your changes in RAD Studio XE10.3 (Rio) so I have done two tests.
1. I have taken your changed 'ZDbcOle*.pas' files and have used it within Zeos snapshot v8.0.0-beta from 3.1.2021.
I have built whole project without any problem. Then I tested our C++ project and it works quit well without any problem. So your correction works very well.
Then I have tried also second C++ project and I found out another little problem what is also connected with OLE DB. It is problem connected with definition ULONG which is use in our second project.
I got following error messages which is due to collision of two header files:
This little problem can be solved by another 'typedef' of 'unsigned long' within our project. However I think it would be fine if this this definition would be solved within ZEOS project. I found out that e.g. "ZPlainMySqlDriver.pas" use ULong definition instead of ULONG but I am not sure if it is possible to use it.
2. Then I downloaded latest Zeos snapshot v8.0.0-beta from 30.1.2021 and I was not able to Build project without correction in project.
Problematic file: 'ZDbcProxyResultSet.pas'. Because of this file the RAD Studio XE10.3 recommended me to add two packages to build project 'Zdbc.dpk' without error. They are 'xmlrtl' and 'soaprtl' packages which I added as 'required' packages. This have helped to create whole Zeos project's components without any problem. I also have had to add 'Soap.EncdDecd' unit into 'Unit scopes names' section because C++ project could not find 'SOAP.ENCDDECD.OBJ' during project linking.
I could changed my C++ project or Zeos project. Both solutions works quite well for me but correction in Zeos project is right I think.
Jan, should I add have new tickets into Zeos bugs tracker regarding above mentioned problems?
Thank you for your help.
Best regards,
Vaclav
I would like to more detail clarify and correct point 2 above. The C++ project needs to have includede 'Soap.EncdDecd.hpp' so I have added following row into 'ZDbcProxyResultSet.pas' file:
{$HPPEMIT '#include <Soap.EncdDecd.hpp>'}
Vaclav
Hello Vaclav,
regarding UINT: I changed the OleDB driver to not declare that type. We now use the Windows unit type UNIT, which should be ok for OleDB ;)
Regarding xmlrt and soaprtl and SOAP.ENCDDECD.OBJ - yes we will have to come to some kind of decision there. I think it will be added.
Which package did you use as the base package for your work? Could you attach the changed package files? I don't know much about C++ Builder and so don't know much about maintaining its packages so theystay up to date...
Best regards,
Jan
Hello Jan,
thank you for your changing regarding of ULONG typedef and using of native Delphi definition what is right step in my opinion. Now we have no problem to use ULONG type in our project. ;-)
Regarding SOAP.ENCDDECD.OBJ
1. We use and compile Zeos for Win32 and Win64. (Also we suppose to use them in Android* apps as well.)
2. I little bit investigated and I found out that in Win64 Platform are some ".hpp" files which have included 'Soap.EncdDecd.hpp' (Zcomponent.hpp and Zdbc.hpp) however 'hpp' files of Win32 platform don't have that file included except of ZDbcProxyResultSet.hpp which is my workaround.
See files in attachment where is also ZDbcProxyResultSet.pas file which I have changed.
I am not sure if I answer your question right. We primary use Zeos components in our projects to connect to Firebird Databases and work with it - ZConnection, ZQuery and similar and also we need to use ZIBEventAlerter (here is some opened issue in bug tracker) and also we would like to use ZMemTable component.
Please give me know if you need some more detail information.
Vaclav
Hello Vaclav,
unfortunately something happened that will eat up all my time during the next two weeks. I will come back here to finish this discussion afterwards.
Best regards,
Jan