You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Tsuyoshi Moriyama <tm...@cs.cmu.edu> on 2003/07/11 20:02:45 UTC

overridden new() might have a problem?

[Environment]
VC++ 6.0 SP5, Win2k/XP, Xerces 2.3.0

I incorporated DOMPrint sample into my own program (basically), but
when I include either DOMTreeErrorReporter.hpp or
DOMPrintErrorHandler.hpp *before* the following section:

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

(which is automatically inserted by MSDev),
I got the following compilation error:

aaa.cpp(70) : error C2661: 'new' : no overloaded function takes 3
parameters,

while if I include it *after* the section, the error message
turns to:

c:\program files\microsoft visual
studio\vc98\include\xercesc\util\xmemory.hpp(94) : error C2061: syntax error
: identifier 'THIS_FILE'
c:\program files\microsoft visual
studio\vc98\include\xercesc\util\xmemory.hpp(94) : error C2091: function
returns function
c:\program files\microsoft visual
studio\vc98\include\xercesc\util\xmemory.hpp(94) : error C2802: static
member 'operator new' has no formal parameters
c:\program files\microsoft visual
studio\vc98\include\xercesc\util\xmemory.hpp(102) : error C2061: syntax
error : identifier 'THIS_FILE'
c:\program files\microsoft visual
studio\vc98\include\xercesc\util\xmemory.hpp(102) : error C2091: function
returns function
c:\program files\microsoft visual
studio\vc98\include\xercesc\util\xmemory.hpp(102) : error C2556: 'void
*(__cdecl *__cdecl xercesc_2_3::XMemory::operator new(void))(unsigned
int,class xercesc_2_3::MemoryManager *)' : overloaded function differs onl
y by return type from 'void *(__cdecl *__cdecl
xercesc_2_3::XMemory::operator new(void))(unsigned int)'
        c:\program files\microsoft visual
studio\vc98\include\xercesc\util\xmemory.hpp(94) : see declaration of 'new'
aaa.cpp(23) : fatal error C1903: unable to recover from previous error(s);
stopping compilation
Error executing cl.exe.

In either way, I can't compile my program.
Do you have any idea how I can fix that?

Tsuyoshi Moriyama
tmoriyam@cs.cmu.edu


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: overridden new() might have a problem?

Posted by Tsuyoshi Moriyama <tm...@cs.cmu.edu>.
Of course, I did the same way to complete compiling, but I
thought I needed to report to help people be aware of it and
fix it if it was not intended.
>From that point of view, I don't know which one is 'offending'.

Anyway, everybody feels fine with it, that's fine with me, too.

Tsuyoshi

----- Original Message ----- 
From: "Gilbert Williams" <gi...@imageguide.us>
To: <xe...@xml.apache.org>; "'Tsuyoshi Moriyama'"
<tm...@cs.cmu.edu>
Sent: Friday, July 11, 2003 3:41 PM
Subject: RE: overridden new() might have a problem?


> I had this problem when going from 2.2 to 2.3.
>
> I removed the offending code block,
> reordered the includes for the windows
> code and got a successful build.
>
> -----Original Message-----
> From: Tsuyoshi Moriyama [mailto:tmoriyam@cs.cmu.edu]
> Sent: Friday, July 11, 2003 2:03 PM
> To: xerces-c-dev@xml.apache.org
> Subject: overridden new() might have a problem?
>
> [Environment]
> VC++ 6.0 SP5, Win2k/XP, Xerces 2.3.0
>
> I incorporated DOMPrint sample into my own program (basically), but
> when I include either DOMTreeErrorReporter.hpp or
> DOMPrintErrorHandler.hpp *before* the following section:
>
> #ifdef _DEBUG
> #define new DEBUG_NEW
> #undef THIS_FILE
> static char THIS_FILE[] = __FILE__;
> #endif
>
> (which is automatically inserted by MSDev),
> I got the following compilation error:
>
> aaa.cpp(70) : error C2661: 'new' : no overloaded function takes 3
> parameters,
>
> while if I include it *after* the section, the error message
> turns to:
>
> c:\program files\microsoft visual
> studio\vc98\include\xercesc\util\xmemory.hpp(94) : error C2061: syntax
> error
> : identifier 'THIS_FILE'
> c:\program files\microsoft visual
> studio\vc98\include\xercesc\util\xmemory.hpp(94) : error C2091: function
> returns function
> c:\program files\microsoft visual
> studio\vc98\include\xercesc\util\xmemory.hpp(94) : error C2802: static
> member 'operator new' has no formal parameters
> c:\program files\microsoft visual
> studio\vc98\include\xercesc\util\xmemory.hpp(102) : error C2061: syntax
> error : identifier 'THIS_FILE'
> c:\program files\microsoft visual
> studio\vc98\include\xercesc\util\xmemory.hpp(102) : error C2091:
> function
> returns function
> c:\program files\microsoft visual
> studio\vc98\include\xercesc\util\xmemory.hpp(102) : error C2556: 'void
> *(__cdecl *__cdecl xercesc_2_3::XMemory::operator new(void))(unsigned
> int,class xercesc_2_3::MemoryManager *)' : overloaded function differs
> onl
> y by return type from 'void *(__cdecl *__cdecl
> xercesc_2_3::XMemory::operator new(void))(unsigned int)'
>         c:\program files\microsoft visual
> studio\vc98\include\xercesc\util\xmemory.hpp(94) : see declaration of
> 'new'
> aaa.cpp(23) : fatal error C1903: unable to recover from previous
> error(s);
> stopping compilation
> Error executing cl.exe.
>
> In either way, I can't compile my program.
> Do you have any idea how I can fix that?
>
> Tsuyoshi Moriyama
> tmoriyam@cs.cmu.edu
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


RE: overridden new() might have a problem?

Posted by Gilbert Williams <gi...@imageguide.us>.
I had this problem when going from 2.2 to 2.3.

I removed the offending code block,
reordered the includes for the windows
code and got a successful build.

-----Original Message-----
From: Tsuyoshi Moriyama [mailto:tmoriyam@cs.cmu.edu] 
Sent: Friday, July 11, 2003 2:03 PM
To: xerces-c-dev@xml.apache.org
Subject: overridden new() might have a problem?

[Environment]
VC++ 6.0 SP5, Win2k/XP, Xerces 2.3.0

I incorporated DOMPrint sample into my own program (basically), but
when I include either DOMTreeErrorReporter.hpp or
DOMPrintErrorHandler.hpp *before* the following section:

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

(which is automatically inserted by MSDev),
I got the following compilation error:

aaa.cpp(70) : error C2661: 'new' : no overloaded function takes 3
parameters,

while if I include it *after* the section, the error message
turns to:

c:\program files\microsoft visual
studio\vc98\include\xercesc\util\xmemory.hpp(94) : error C2061: syntax
error
: identifier 'THIS_FILE'
c:\program files\microsoft visual
studio\vc98\include\xercesc\util\xmemory.hpp(94) : error C2091: function
returns function
c:\program files\microsoft visual
studio\vc98\include\xercesc\util\xmemory.hpp(94) : error C2802: static
member 'operator new' has no formal parameters
c:\program files\microsoft visual
studio\vc98\include\xercesc\util\xmemory.hpp(102) : error C2061: syntax
error : identifier 'THIS_FILE'
c:\program files\microsoft visual
studio\vc98\include\xercesc\util\xmemory.hpp(102) : error C2091:
function
returns function
c:\program files\microsoft visual
studio\vc98\include\xercesc\util\xmemory.hpp(102) : error C2556: 'void
*(__cdecl *__cdecl xercesc_2_3::XMemory::operator new(void))(unsigned
int,class xercesc_2_3::MemoryManager *)' : overloaded function differs
onl
y by return type from 'void *(__cdecl *__cdecl
xercesc_2_3::XMemory::operator new(void))(unsigned int)'
        c:\program files\microsoft visual
studio\vc98\include\xercesc\util\xmemory.hpp(94) : see declaration of
'new'
aaa.cpp(23) : fatal error C1903: unable to recover from previous
error(s);
stopping compilation
Error executing cl.exe.

In either way, I can't compile my program.
Do you have any idea how I can fix that?

Tsuyoshi Moriyama
tmoriyam@cs.cmu.edu


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org