unable to get CPP WPTools-derived components to install

This is the forum for miscellaneous technical/programming questions.

Moderator: 2ffat

unable to get CPP WPTools-derived components to install

Postby Azazaz » Fri Apr 10, 2015 7:38 pm

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?
Azazaz
BCBJ Guru
BCBJ Guru
 
Posts: 105
Joined: Wed Sep 26, 2012 9:08 am

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

Postby Azazaz » Sun Apr 12, 2015 6:30 pm

Sorry. It has come to my attention that I did not provide enough information.
Azazaz
BCBJ Guru
BCBJ Guru
 
Posts: 105
Joined: Wed Sep 26, 2012 9:08 am

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

Postby rlebeau » Sun Apr 12, 2015 6:37 pm

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.
Remy Lebeau (TeamB)
Lebeau Software
User avatar
rlebeau
BCBJ Author
BCBJ Author
 
Posts: 1559
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA

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

Postby Azazaz » Wed Apr 15, 2015 9:28 pm

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.
Azazaz
BCBJ Guru
BCBJ Guru
 
Posts: 105
Joined: Wed Sep 26, 2012 9:08 am


Return to Technical

Who is online

Users browsing this forum: Bing [Bot] and 22 guests

cron