Page 1 of 1

unable to get CPP WPTools-derived components to install

PostPosted: Fri Apr 10, 2015 7:38 pm
by Azazaz
I'm working with C++Builder XE6 & XE7. I've derived some CPP components from WPTools (Pascal-based) components and have been unable to get them to work with WPTools7, although they worked fine with WPTools6 and earlier versions of XE.

When trying to build my derived CPP components, Builder does not seem to like the passing by reference code it is finding in the WPTools .HPP files.

Lines like the following:

extern DELPHI_PACKAGE bool __fastcall WPLocateNextPrev(bool Previous, TParagraph* &active_paragraph, int &active_posinpar, bool &EOF);
extern DELPHI_PACKAGE bool __fastcall WPLocateNext(TParagraph* &active_paragraph, int &active_posinpar, bool &EOF);
extern DELPHI_PACKAGE bool __fastcall WPLocatePrev(TParagraph* &active_paragraph, int &active_posinpar, bool &BOF);

For which I get errors like this:

[bcc32 Error] WPRTEDefs.hpp(6117): extern variable cannot be initialized
[bcc32 Error] WPRTEDefs.hpp(6117): Improper use of typedef 'TParagraph'
[bcc32 Error] WPRTEDefs.hpp(6117): Undefined symbol 'active_paragraph'

It is not apparent to me that the above declarations in the .HPP code is trying to initialize an extern variable, but please enlighten me if that is the case.

The developer, usually very helpful in the past, hasn't been all that helpful this time around. I'm not sure if he doesn't know what the problem is, if he is too busy, or if he just doesn't have any other customers who have tried deriving CPP components the way I have.

If I have to give up my CPP WPTools-derived components, it will probably take a month or more to revise all my code, so I am eager to find a solution if there is one. Does anyone know a fix for this?

Re: unable to get CPP WPTools-derived components to install

PostPosted: Sun Apr 12, 2015 6:30 pm
by Azazaz
Sorry. It has come to my attention that I did not provide enough information.

Re: unable to get CPP WPTools-derived components to install

PostPosted: Sun Apr 12, 2015 6:37 pm
by rlebeau
Azazaz wrote:[bcc32 Error] WPRTEDefs.hpp(6117): extern variable cannot be initialized


I do not know which 'extern variable' it is complaining about, since there is no such variable in the code you showed, however...

Azazaz wrote:[bcc32 Error] WPRTEDefs.hpp(6117): Improper use of typedef 'TParagraph'
[bcc32 Error] WPRTEDefs.hpp(6117): Undefined symbol 'active_paragraph'


These imply that TParagraph has not been defined yet, such as if another .HPP file was not included beforehand.

Azazaz wrote:It is not apparent to me that the above declarations in the .HPP code is trying to initialize an extern variable


It is not.

Re: unable to get CPP WPTools-derived components to install

PostPosted: Wed Apr 15, 2015 9:28 pm
by Azazaz
I commented these 3 lines out of the .HPP file and everything built fine.

The developer thinks it is a flaw in XE6 & XE7. If commenting out the lines doesn't cause me trouble, I'll just go with it for now.

Thanks for the feedback by the way.