Page 1 of 1

C++Builder New Packages

Posted: 23.01.2015, 00:23
by mac_srv
Hi All,

I'm a C++Builder developer and I know this is a Delphi and FPC comunity. Since ZeosDBO seems to me a very important option compared to other native, or not, DB Access frameworks, manly if you take our freedom and budgets into account, I would like to share or contribute to ZeosDBO work.

I would like to ask to this comunity if there is interest on update the C++Builder Packages.

I've tested the "cbuilder12" packages and I had to change on some Project options and Paths to properly compile and install ZeosDBO on C++Builder (RAD) 2009.

I can provide some feedback, in form of a new C++Builder installation manual, as I'll try this installation on BDS2006 and C++Builder XE2. I also would share my packages/project files.

If these ideas looks interesting to you, please let me know.

Regards,

Marcelo Augusto.
HydroByte Software

Re: C++Builder New Packages

Posted: 24.01.2015, 10:49
by miab3
@mac_srv,

Include a zip package directory for C++ here.

Michal

Re: C++Builder New Packages

Posted: 24.01.2015, 15:41
by mac_srv
Hi Michal,

Attached to this replay there is a "ZeosDbo-Packages-CBuilder2009" zip folder with new group and projects configuration.

I've also provided a draft for a Manual entry about CBuilder installation.

BTW, I've found problems compiling "ZPlainMySqlConstants.pas" on BDS2006 with C++ Personality (with new package group projects). It seems BDS2006 could not compile the enum TMysqlFieldTypes properly, as ZPlainMySqlConstants.hpp stops at "struct TMYSQL_FIELD {... unsigned charsetnr;".

Also, in CBuilderXE2, I was able to compile ZeosDbo but the ZComponent.bpl Install failed with message:
"Entry Point Not Found. The procedure entry point @$xp$28Zcompatibility@PZConSettings could not be located in the dynamic link library ZCore.bpl"

Do you think may I create new Posts to these two problems? The better place is here, in "ZeosLib 7.1 stable Forum"?

I hope you can get some help with these problems, but I do not want to take your time with CBuilder issues.

Regards,

Marcelo.

Re: C++Builder New Packages

Posted: 25.01.2015, 00:26
by miab3
@mac_srv,

It would be nice as you would have tried with ZEOS 7.2 Revision 3609 (which is a compatible extension of ZEOS 7.1.4).
http://svn.code.sf.net/p/zeoslib/code-0 ... sting-7.2/
In my Delphi 2007 and Delphi XE2 generated the correct C ++ .h source and library, by allowing compile applications in C++.
http://zeoslib.sourceforge.net/viewtopi ... 485#p37485

Michal

Re: C++Builder New Packages

Posted: 25.01.2015, 01:03
by mac_srv
Hi Michal,

Nice hint!

I'll try ZEOS 7.2 Revision 3609 and reply to you soon.

Thanks.

Marcelo.

Re: C++Builder New Packages

Posted: 25.01.2015, 16:19
by mac_srv
Hi Michal,

I've tested my packages with ZEOS 7.2 Revision 3609 source code.

Status
Here is a status of my work with CBuilder packages:
- CBuilder2009: Compile OK, Install OK, Test App OK.
- CBuilderXE2: Compile OK, Install OK, Test App Error.
- CBuilder2006: Compile Error.

Important
The origins of my packages:
- CBuilder2009: was based into original cbuilder12.
- CBuilderXE2: opened CBuilder2009 and saved as XE2 projects.
- CBuilder2006: created new from scratch.

Multi builds
I've found out that some problems with Bpl Installation was related to two or more ZeosDbo builds into the same machine. So I've changed the projects names to include CBuilder version (BDS2006 = 100, RAD2009 = 120 and XE2 = 160).

CBuilderXE2 Problem
I've compiled and installed ZeosDBO in CBuilder XE2. When testint it with a Tesp App using Firebird 2.5, I receive these errors:
"Project PrjTest01.exe raised exception class $C0000005 with message 'access violation at 0x500439e1: read of address 0x249a9d03'."
"Access violation ad address 500439E1 in module 'rtl160.bpl'. Read of address 0061006D."
Similar to what was reported in this entry http://zeoslib.sourceforge.net/viewtopi ... XE2#p17071 (16.03.2013, 15:43).

CBuilder2006 Problems
It can't compile "ZPlainMySqlConstants.pas" with F2084 Internal Error.
I've checked the "ZPlainMySqlConstants.hpp" and it still stops just before the TMysqlFieldTypes first declaration:

Code: Select all

struct TMYSQL_FIELD 
{
public:
  char *name;
  ... 
  unsigned charsetnr;
  //My comment: hpp files ends here.
Compared to the same hpp file generated in CBuilder2009, it stops just before "TMysqlFieldTypes _type;". It seems to me that some DCC32 option is missing in order to right convert the TMysqlFieldTypes enum. Maybe some related to non-consecutive enum items.

Attachments
Attached to thes post you can find the new versions of CBuilder packages and the draft Installation Manual.

I hope you can give some feedback to help me go forward.

Thanks,

Marcelo.

Re: C++Builder New Packages

Posted: 26.01.2015, 10:53
by miab3
@mac_srv,
mac_srv wrote: Status
Here is a status of my work with CBuilder packages:
- CBuilder2009: Compile OK, Install OK, Test App OK.
- CBuilderXE2: Compile OK, Install OK, Test App Error.
- CBuilder2006: Compile Error.

Important
The origins of my packages:
- CBuilder2009: was based into original cbuilder12.
- CBuilderXE2: opened CBuilder2009 and saved as XE2 projects.
- CBuilder2006: created new from scratch.

Multi builds
I've found out that some problems with Bpl Installation was related to two or more ZeosDbo builds into the same machine. So I've changed the projects names to include CBuilder version (BDS2006 = 100, RAD2009 = 120 and XE2 = 160).

CBuilderXE2 Problem
I've compiled and installed ZeosDBO in CBuilder XE2. When testint it with a Tesp App using Firebird 2.5, I receive these errors:
"Project PrjTest01.exe raised exception class $C0000005 with message 'access violation at 0x500439e1: read of address 0x249a9d03'."
"Access violation ad address 500439E1 in module 'rtl160.bpl'. Read of address 0061006D."
Similar to what was reported in this entry http://zeoslib.sourceforge.net/viewtopi ... XE2#p17071 (16.03.2013, 15:43).
If you have more than one CBuilder version on your computer then you have to also take care of
the environmental PATHS for the various compilers (so as not to overlap, intersect).
Just like for many Delphi versions on the same computer.

Michal

Re: C++Builder New Packages

Posted: 26.01.2015, 11:40
by mac_srv
Hi Michal,
If you have more than one CBuilder version on your computer then you have to also take care of
the environmental PATHS for the various compilers (so as not to overlap, intersect).
Just like for many Delphi versions on the same computer.
All right, the PATH was configurated because I've changed the BPL folder to be inside CBuilderXXXX packages folders. I've put some instructions about it just into the beginning of the draft manual.

Any other hint about the error with XE2 or the compile problem with BDS2006?

Thanks,

Marcelo.

Re: C++Builder New Packages

Posted: 26.01.2015, 12:12
by miab3
@mac_srv,

I do not know why are you error appears.
This project (attached):
0CPPFB.ZIP
just wrote in C ++ RAD Studio XE2 and running.

And here version with static linking of all libraries, and it works too:
0CPPFB1.ZIP
Michal

Re: C++Builder New Packages

Posted: 03.02.2015, 23:38
by mac_srv
Hi Michal,

(sorry about the delay).

The two test projects you have shared worked fine with my installation of C++Builder XE2 and ZeosDBO.

I've changed my test project to be static linked and now it is working. I have some problem with dynamic linking the ZeosDbo packages. As you did, I just created a new VCL Application project, droped a DBGrid, DataSource and Zeos ZConnection and ZQuery.

I'll try do figure out why. Any hint about that? No rush.

Just one complementary doubt: do you have C++Builder XE2 ZeosDBO packages or did you used my files shared in this thread?

Thanks for your help.

Marcelo

Re: C++Builder New Packages

Posted: 04.02.2015, 00:18
by miab3
@mac_srv,

I use the C++ .h and .lib generated when building packages in Delphi Pascal.

Michal

Re: C++Builder New Packages

Posted: 04.02.2015, 12:06
by mac_srv
Michal,

I've found the problem with my test project. Actually, I've changed an option, by mistake, in my C++Builder XE2 ZeosDBO packages. I've set "Link with Dynamic RTL" to "true".

I've recompiled with this option to "false" and now the test project works with static and dynamic link.

Status
Here is a status of my work with CBuilder packages:
- CBuilder2009: Compile OK, Install OK, Test App OK.
- CBuilderXE2: Compile OK, Install OK, Test App OK.
- CBuilder2006: Compile Error.

I'll try your strategy with BDS 2006, using Delphi packages to create C++ necessary files.

I'll come back soon and share my work with you and this community.

Thank you.

Marcelo.

Re: C++Builder New Packages

Posted: 11.02.2015, 13:41
by mac_srv
Hi Michal,

This is a report about BDS 2006, aiming to compile and install in C++Builder.

I'll show my results as an item-based report.


1. Existing Delphi2005 Package

If you open the Delphi2005's project group into BDS 2006, with Delphi personality, you are able to compile and install ZeosDBO without any problem. So, you can use ZeosDBO with Delphi projects swimmingly.


2. New Delphi2006 Package
In order to compile in C++Builder, I've saved Delphi2005 folder as Delphi2006, opened it and tried to change the Linker option to "Generate All C++ Builder Files". This actions let me found the first problem, as described into the next sub-item.

2.1. Problem with Delphi Precompiler.
I've found a problem with BDS 2006 when editing Delphi the options of projects that use precompiler {$IFDEF SOMETHING}...{$ENDIF}. I was able to verify this problem with *.dpk Delphi files that use precompiler instructions, like ZPlain.dpk, ZDbc.dpk, ZParseSql.dpk and ZComponent.dpk. I've discovered, at least on my BDS 2006 installation, that those lines using the Delphi Precompiler are ignored, so the "Contains" list shown in Project Manager just present lines that are outside precompiler instructions.

In order to continue, I've removed all precompiler instructions, eliminating the Zeos.inc DBMS options that permit to reduce final binary files on *.bpk include/exclude filters. You can check this task into the attached Delphi2006 *.dpk files.

So, I was able to open Delphi2006 group project again and try a "Build all projects" task. After that, I've found new problems, as described into the next sub-item.

2.2. Access violation in module 'dcc100.dll'.
With BDS 2006 Delphi personality, the building progress stops at ZPlain.dpk project with this error message: "Access violation at address 22028FB3 in module 'dcc100.dll'. Read of address 00000018.".

I've tried such an effort reading Google results and testing options and do not realize the source of this problem. The best reference about this error was http://stackoverflow.com/questions/1533 ... error-la33.

Also I was able to discover that " ZPlainMySqlConstants.pas " was not processed properly, in order to generate the .hpp header file. The header stops at:

Code: Select all

...
struct LIST
{
public:
	LIST *prev;
	LIST *next;
So, with my previous experience creating and compiling a ZeosDBO's CBuilder2006 problematic package, I've decided to eliminate MySQL files from all packages. So, I've commented those lines into dpk files:

Code: Select all

[ZPlain.dpk]
  {ZPlainMySqlDriver in '..\..\src\plain\ZPlainMySqlDriver.pas',
  ZPlainMySqlConstants in '..\..\src\plain\ZPlainMySqlConstants.pas',}

[ZDbc.dpk]
  {ZDbcMySql in '..\..\src\dbc\ZDbcMySql.pas',
  ZDbcMySqlMetadata in '..\..\src\dbc\ZDbcMySqlMetadata.pas',
  ZDbcMySqlResultSet in '..\..\src\dbc\ZDbcMySqlResultSet.pas',
  ZDbcMySqlStatement in '..\..\src\dbc\ZDbcMySqlStatement.pas',
  ZDbcMySqlUtils in '..\..\src\dbc\ZDbcMySqlUtils.pas',}
  
I've build again and had to comment these lines into "ZAbstractConnection.pas":

Code: Select all

...
{{$IFDEF ENABLE_MYSQL}
{  ZDbcMySql,
{{$ENDIF}
With these modifications, I was able to compile and install ZeosDBO with Linker option "Generate All C++ Builder Files". Besides, with the generated *.hpp, *.bpi, *.lib and *.bpl files, I was able to test ZeosDBO components with C++Builder personality.


3. New CBuilder2006 Package
With this report in mind, I've improved my CBuilder2006 packages and had success compiling and installing ZeosDBO into C++Builder personality, without Delphi generated files, but deleting the MySQL files listed in sub-item 2.2. These new packages projects redirects output to "\Bpl", "\Include" and "\Lib" folders, as I did with CBuilder2009 and CBuilderXE2.


4. Conclusions
I don't know if somebody can reproduce these results, but my conclusion is that BDS 2006 breaks trying to compile "\plain\ZPlainMySqlConstants.pas".
I know this is a legacy problem, since C++Builder 2009 and XE2 don't reach any problem with this file.

Also, I've talked with BCB Journal's editor about ZeosDBO and they have interest on this subject. They are willing to test my packages and give some feedback. So, the final task could be a formalized article about this experiences with ZeosDBO and C++Builder.

I apologize about the length of this report, but I think these results might help others C++Builder users.

Regards,

Marcelo

Re: C++Builder New Packages

Posted: 11.02.2015, 16:56
by miab3
@mac_srv,

I also had problems with C ++ in BDS2006, therefore I tested ZEOS C ++ in RAD Studio 2007,
which is building a library of C ++ without any problem.
(All my non-Unicode applications I moved to 2007).

Michal

Re: C++Builder New Packages

Posted: 11.02.2015, 17:39
by mac_srv
Hi Michal,

Thanks for your reply. Actually, I'm moving my applications to RAD 2009 and XE2 too. I've tested the packages with BDS 2006, RAD 2009 and C++Builder XE2 just for proofing all my IDE's installation.

Please, do no take my report as an demand on ZeosDBO code. That wasn't my intention.

Now, I'll share my packages and draft manual with BCB Journal's Forum and wait for some feedback, mainly related to tests with C++Builder XE3 or up.

I think the final work could be interesting for ZeosDBO community, in terms of C++Builder users aggregation.

Also, I've talked with BCB Journal's editor about an extra article reporting my experience, an ongoing task by now, of migrating a cliente/server midsize BDE application, with a TDataModule with 50 TQuery, to ZeosDBO's components. I'm testing some automatic code refactoring using Regular Expressions.

If you agree, I think I can share some feedback and instructions to this community too.

Thanks.

Marcelo.