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 Milan Tomic <mi...@setcce.org> on 2004/03/12 11:29:29 UTC

Debug mode compilation under VC++6

	I've tried to compile my app using Debug mode (VC++ 6) and got
those exceptions:

c:\download\xml\apache\xerces-c-src_2_3_0\xerces-c-src_2_3_0\src\xercesc
\util\emptystackexception.hpp(69) : error C2661: 'new' : no overloaded
function takes 3 parameters
error C2661: 'new' : no overloaded function takes 3 parameters
error C2661: 'new' : no overloaded function takes 3 parameters
error C2661: 'new' : no overloaded function takes 3 parameters
error C2661: 'new' : no overloaded function takes 3 parameters
error C2661: 'new' : no overloaded function takes 3 parameters
error C2661: 'new' : no overloaded function takes 3 parameters
error C2661: 'new' : no overloaded function takes 3 parameters
error C2661: 'new' : no overloaded function takes 3 parameters
error C2661: 'new' : no overloaded function takes 3 parameters
error C2661: 'new' : no overloaded function takes 3 parameters
error C2661: 'new' : no overloaded function takes 3 parameters
error C2661: 'new' : no overloaded function takes 3 parameters

	Anyone knows why? Xerces FAQ didn't help me.

Thank you.

Re: Debug mode compilation under VC++6

Posted by Kai-Uwe Schmidt <ku...@sawag.com>.
Hi,


you should try xerces_2_5_0. That works fine for me in debug and release mode under VC6.0.

Kai-Uwe


Am Fr 12.03.2004 11:29, Milan Tomic <mi...@setcce.org> schrieb:

> 
> 	I've tried to compile my app using Debug mode (VC++ 6) and got
> those exceptions:
> 
> c:\download\xml\apache\xerces-c-src_2_3_0\xerces-c-src_2_3_0\src\xercesc
> \util\emptystackexception.hpp(69) : error C2661: 'new' : no overloaded
> function takes 3 parameters
> error C2661: 'new' : no overloaded function takes 3 parameters
> error C2661: 'new' : no overloaded function takes 3 parameters
> error C2661: 'new' : no overloaded function takes 3 parameters
> error C2661: 'new' : no overloaded function takes 3 parameters
> error C2661: 'new' : no overloaded function takes 3 parameters
> error C2661: 'new' : no overloaded function takes 3 parameters
> error C2661: 'new' : no overloaded function takes 3 parameters
> error C2661: 'new' : no overloaded function takes 3 parameters
> error C2661: 'new' : no overloaded function takes 3 parameters
> error C2661: 'new' : no overloaded function takes 3 parameters
> error C2661: 'new' : no overloaded function takes 3 parameters
> error C2661: 'new' : no overloaded function takes 3 parameters
> 
> 	Anyone knows why? Xerces FAQ didn't help me.
> 
> Thank you.




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


RE: Debug mode compilation under VC++6

Posted by Milan Tomic <mi...@setcce.org>.
> >And got 228 unresolved linker errors.
> 
> Try removing just the line
> 
> #define new DEBUG_NEW
No, it doesn't work. Still the same.

Best regards,
Milan



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


RE: Debug mode compilation under VC++6

Posted by Alberto Massari <am...@progress.com>.
At 15.01 12/03/2004 +0100, you wrote:

> > are you declaring another one?
>No. I'm using Xalan & XSec, maybe they declare one?
>
> > before any #include statement; in this case, move it to
> > be after all
> > the #include and before your code (or remove it altogether)
>I don't understand what I should remove and why? I've tried to remove
>this:
>
>#ifdef _DEBUG
>#define new DEBUG_NEW
>#undef THIS_FILE
>static char THIS_FILE[] = __FILE__;
>#endif
>
>And got 228 unresolved linker errors.

Try removing just the line

#define new DEBUG_NEW

Alberto


>Best regards,
>Milan
>
>
>
>---------------------------------------------------------------------
>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: Debug mode compilation under VC++6

Posted by Milan Tomic <mi...@setcce.org>.
> are you declaring another one?
No. I'm using Xalan & XSec, maybe they declare one?

> before any #include statement; in this case, move it to 
> be after all 
> the #include and before your code (or remove it altogether)
I don't understand what I should remove and why? I've tried to remove
this:

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

And got 228 unresolved linker errors.

Best regards,
Milan



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


RE: Debug mode compilation under VC++6

Posted by Alberto Massari <am...@progress.com>.
At 14.45 12/03/2004 +0100, you wrote:

>         Thank you very much, for your help. Your solution solved first
>compiler error. Other 12 persists. Those are places in my code where
>compiler errors occures:
>
>DOMPrintFormatTarget* formatTarget = new DOMPrintFormatTarget();
>gFormatter = new XMLFormatter("UTF-8", 0, formatTarget,
>XMLFormatter::NoEscapes, gUnRepFlags);
>myFormTarget = new MemBufFormatTarget(5000);
>
>         It is obvious that error occures when I use "new" operator on
>Xerces classes. This is error message:
>
>error C2661: 'new' : no overloaded function takes 3 parameters

When you compile your code using that macro, every instance of "new" is 
replaced with a "new (__FILE__,__LINE__)" expression, used to keep track of 
allocations and reporting memory leaks at the end. If the compiler 
complains that "no overloaded function takes 3 parameters", it means that 
the global "new" operator has been replaced by another one; as Xerces 
should have properly defined all the versions (see util/XMemory.hpp), are 
you declaring another one?

Alberto

>Best regards,
>Milan
>
>
> > -----Original Message-----
> > From: Alberto Massari [mailto:amassari@progress.com]
> > Sent: Friday, March 12, 2004 2:10 PM
> > To: xerces-c-dev@xml.apache.org
> > Subject: Re: Debug mode compilation under VC++6
> >
> >
> > Check if your .cpp file has these macro definitions
> >
> > #ifdef _DEBUG
> > #undef THIS_FILE
> > static char THIS_FILE[]=__FILE__;
> > #define new DEBUG_NEW
> > #endif
> >
> > before any #include statement; in this case, move it to be
> > after all the
> > #include and before your code (or remove it altogether)
> >
> > Alberto
>
>
>
>---------------------------------------------------------------------
>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: Debug mode compilation under VC++6

Posted by Milan Tomic <mi...@setcce.org>.
	Thank you very much, for your help. Your solution solved first
compiler error. Other 12 persists. Those are places in my code where
compiler errors occures:

DOMPrintFormatTarget* formatTarget = new DOMPrintFormatTarget();
gFormatter = new XMLFormatter("UTF-8", 0, formatTarget,
XMLFormatter::NoEscapes, gUnRepFlags);
myFormTarget = new MemBufFormatTarget(5000);

	It is obvious that error occures when I use "new" operator on
Xerces classes. This is error message:

error C2661: 'new' : no overloaded function takes 3 parameters

Best regards,
Milan


> -----Original Message-----
> From: Alberto Massari [mailto:amassari@progress.com] 
> Sent: Friday, March 12, 2004 2:10 PM
> To: xerces-c-dev@xml.apache.org
> Subject: Re: Debug mode compilation under VC++6
> 
> 
> Check if your .cpp file has these macro definitions
> 
> #ifdef _DEBUG
> #undef THIS_FILE
> static char THIS_FILE[]=__FILE__;
> #define new DEBUG_NEW
> #endif
> 
> before any #include statement; in this case, move it to be 
> after all the 
> #include and before your code (or remove it altogether)
> 
> Alberto



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


Re: Debug mode compilation under VC++6

Posted by Alberto Massari <am...@progress.com>.
Check if your .cpp file has these macro definitions

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

before any #include statement; in this case, move it to be after all the 
#include and before your code (or remove it altogether)

Alberto

At 11.29 12/03/2004 +0100, Milan Tomic wrote:

>         I've tried to compile my app using Debug mode (VC++ 6) and got 
> those exceptions:
>
>c:\download\xml\apache\xerces-c-src_2_3_0\xerces-c-src_2_3_0\src\xercesc\util\emptystackexception.hpp(69) 
>: error C2661: 'new' : no overloaded function takes 3 parameters
>
>error C2661: 'new' : no overloaded function takes 3 parameters
>error C2661: 'new' : no overloaded function takes 3 parameters
>error C2661: 'new' : no overloaded function takes 3 parameters
>error C2661: 'new' : no overloaded function takes 3 parameters
>error C2661: 'new' : no overloaded function takes 3 parameters
>error C2661: 'new' : no overloaded function takes 3 parameters
>error C2661: 'new' : no overloaded function takes 3 parameters
>error C2661: 'new' : no overloaded function takes 3 parameters
>error C2661: 'new' : no overloaded function takes 3 parameters
>error C2661: 'new' : no overloaded function takes 3 parameters
>error C2661: 'new' : no overloaded function takes 3 parameters
>error C2661: 'new' : no overloaded function takes 3 parameters
>
>         Anyone knows why? Xerces FAQ didn't help me.
>
>Thank you.



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