| View previous topic :: View next topic |
| Author |
Message |
Udo Weik Guest
|
Posted: Mon May 14, 2007 11:54 pm Post subject: BDS2006: #define-Conflict due to winspool.h |
|
|
Hello,
I'm using a 3rd Party component which has a method "AddForm".
When I use that method, I get the following linker error:
Unresolved external '__fastcall NAMESPACE::COMPONENT::AddFormA( ... *)'
referenced from ... XYZ_UNIT1.OBJ
In winspool.h is a #define which is the reason for that problem:
#ifdef UNICODE
#define AddForm AddFormW
#else
#define AddForm AddFormA
#endif // !UNICODE
Does anybody know a solution (apart from renaming the method...)?
Thanks and greetings
Udo |
|
| Back to top |
|
 |
Craig Farrell Guest
|
Posted: Tue May 15, 2007 12:37 am Post subject: Re: BDS2006: #define-Conflict due to winspool.h |
|
|
Hi,
| Quote: |
In winspool.h is a #define which is the reason for that problem:
#ifdef UNICODE
#define AddForm AddFormW
#else
#define AddForm AddFormA
#endif // !UNICODE
|
Does an undef help,e.g.
#include <winspool.h?
#undef AddForm
Or does that just move the problem somewhere else?
--Craig |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Tue May 15, 2007 3:30 am Post subject: Re: BDS2006: #define-Conflict due to winspool.h |
|
|
"Udo Weik" <WeikEngOff (AT) aol (DOT) com> wrote in message
news:4648b013 (AT) newsgroups (DOT) borland.com...
| Quote: | In winspool.h is a #define which is the reason for that problem:
|
Winspool has other defines that interfer with various VCL methods
(such as SetPort()). This is documented on Borland's website (go to
http://search.borland.com). Microsoft's whole approach to using
macros for function overloading causes all kinds of havoc on the VCL.
Gambit |
|
| Back to top |
|
 |
Udo Weik Guest
|
Posted: Tue May 15, 2007 11:37 pm Post subject: Re: BDS2006: #define-Conflict due to winspool.h |
|
|
Hello Craig,
| Quote: | Does an undef help,e.g.
#include <winspool.h?
#undef AddForm
|
yep, works, inserted in the *.cpp-file:
include <vcl.h>
#pragma hdrstop
#include <winspool.h>
#undef AddForm
#include "XYZ_UNIT1.h"
Many thanks you both.
Udo |
|
| Back to top |
|
 |
|