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 "Peter A. Volchek" <Pe...@ti.com.od.ua> on 2001/06/01 14:57:56 UTC

VC5 compiler errors

Here some errors that I got, when compiled xerces with VC5 compiler.

--------------------------------
F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(324) : error C2561:
'getSize' : function must return a value
F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(329) : error C2561:
'getData' : function must return a value
F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(334) : error C2561:
'getData2' : function must return a value
F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(339) : error C2561:
'getRefNo' : function must return a value
F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(344) : error C2561:
'elementAt' : function must return a value
F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(349) : error C2561:
'getChild' : function must return a value
F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(354) : error C2561:
'getConditionFlow' : function must return a value
F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(359) : error C2561:
'getYesFlow' : function must return a value
F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(364) : error C2561:
'getNoFlow' : function must return a value
F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(369) : error C2561:
'getLiteral' : function must return a value
F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(374) : error C2561:
'getToken' : function must return a value

I understand that some inline functions are just dummy stubs, but can you
add also the dummy return value
to the end of them, like this:

inline int Op::getSize() const {
    ThrowXML(RuntimeException, XMLExcepts::Regex_NotSupported);
    return 0
}
-------------------------------------------
Same for process* functions in ParserForXMLSchema.cpp
-------------------------------------------
IDNodeIteratorImpl.cpp
F:\code\Xerces\src\ibmxml\xerces\src\idom\IDNodeIteratorImpl.cpp(71) : fatal
error C1083: Cannot open include file: 'NodeIteratorImpl.hpp': No such file
or directory
IDRangeImpl.cpp
F:\code\Xerces\src\ibmxml\xerces\src\idom\IDRangeImpl.cpp(62) : fatal error
C1083: Cannot open include file: 'NodeImpl.hpp': No such file or directory
IDTreeWalkerImpl.cpp
F:\code\Xerces\src\ibmxml\xerces\src\idom\IDTreeWalkerImpl.cpp(67) : fatal
error C1083: Cannot open include file: 'TreeWalkerImpl.hpp': No such file or
directory

I got rid of these by adding the path to
F:\code\Xerces\src\ibmxml\xerces\src\dom in my include environment.
------------------------------------------
VCPPDefs.cpp

F:\code\Xerces\src\ibmxml\xerces\src\util/Compilers/VCPPDefs.hpp(177) :
error C2816: alternative form of 'operator delete' must be a member
F:\code\Xerces\src\ibmxml\xerces\src\util/Compilers/VCPPDefs.hpp(177) :
error C2810: second formal parameter for 'operator delete' must be 'unsigned
int'

Here the code.
class IDOM_Document;
inline void operator delete(void* ptr, IDOM_Document *doc)
{
    return;
}

Here is the error explanation :
Compiler Error C2816
alternative form of 'operator delete' must be a member

The two-parameter form of the operator delete can be redefined only within a
class, structure, or union. Global redefinitions of operator delete are
allowed to have only one parameter.

I just commented that code and it compiled.
----------------------------------------------------------


Peter A. Volchek
Software Engineer
Metis International, Inc.
PeterV@ti.com.od.ua



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


Re: VC5 compiler errors

Posted by "Peter A. Volchek" <Pe...@ti.com.od.ua>.
> >> Re: Error C1083 in IDNodeIteratorImpl.cpp, IDRangeImpl.cpp,
> IDTreeWalkerImpl.cpp
>
> These 3 files are incomplete, and should be EXCLUDE from your file list.
I am
> trying very hard to finish them but not yet.  So in the meantime, please
exclude
> them from your project file, don't even compile it.  Or please use the
provided
> project file: Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp which
should
> have the correct list of files.

After I removed them, the project was compiled and link ok.


> And BTW it is recommended that you use MSVC 6.0 SP3 instead of VC5 as
Win32 MSVC
> 6.0 SP3 is the tested configuration for binaries.

It does not depend on me which compiler to use :(


Regards,
Peter




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


Re: VC5 compiler errors

Posted by Tinny Ng <tn...@ca.ibm.com>.
Peter,

>> Re: Error C1083 in IDNodeIteratorImpl.cpp, IDRangeImpl.cpp,
IDTreeWalkerImpl.cpp

These 3 files are incomplete, and should be EXCLUDE from your file list.  I am
trying very hard to finish them but not yet.  So in the meantime, please exclude
them from your project file, don't even compile it.  Or please use the provided
project file: Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp which should
have the correct list of files.

>> Re: C2816 and C2810 for operator delete ...
The problem is IDOM design needs to overload to operator new to
        void * operator new(size_t amt, IDOM_Document *doc)
And Microsoft Visual C++ Version 6.0 requires a matching operator delete for
this overloaded operator new; otherwise it will give the following warning
message:
       C4219: no matching operator delete found; memory will not be freed if
initialization throws an exception
So that's why we put a dummy operator delete in VCPPDefs.hpp to bypass the
warning message C4219.

But you said that VC5 gives error for this dummy operator delete.  So it seems
the VC5 and VC6 have conflicting behaviour....

So to satisfy both VC5 and VC6, one solution is instead of providing the dummy
operator delete, may be we can just suppress the warning C4219 in VCPPDefs.hpp:

-  //
---------------------------------------------------------------------------
-  //  For IDOM: define a dummy delete to get rid of compiler warning C4291:
-  //    no matching operator delete found; memory will not be freed if
initialization throws an exception
-  //
---------------------------------------------------------------------------
-  class IDOM_Document;
-  inline void operator delete(void* ptr, IDOM_Document *doc)
-  {
-      return;
-   }

+  //
---------------------------------------------------------------------------
+  //  For IDOM:
+  //  Ignore compiler warning:
+  //    no matching operator delete found; memory will not be freed if
initialization throws an exception
+  //
---------------------------------------------------------------------------
+  #pragma warning( push )
+  #pragma warning( disable : 4291 )

And BTW it is recommended that you use MSVC 6.0 SP3 instead of VC5 as Win32 MSVC
6.0 SP3 is the tested configuration for binaries.  See
http://xml.apache.org/xerces-c/index.html.

Thanks!

Tinny


"Peter A. Volchek" wrote:

> Here some errors that I got, when compiled xerces with VC5 compiler.
>
> --------------------------------
> F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(324) : error C2561:
> 'getSize' : function must return a value
> F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(329) : error C2561:
> 'getData' : function must return a value
> F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(334) : error C2561:
> 'getData2' : function must return a value
> F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(339) : error C2561:
> 'getRefNo' : function must return a value
> F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(344) : error C2561:
> 'elementAt' : function must return a value
> F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(349) : error C2561:
> 'getChild' : function must return a value
> F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(354) : error C2561:
> 'getConditionFlow' : function must return a value
> F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(359) : error C2561:
> 'getYesFlow' : function must return a value
> F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(364) : error C2561:
> 'getNoFlow' : function must return a value
> F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(369) : error C2561:
> 'getLiteral' : function must return a value
> F:\code\Xerces\src\ibmxml\xerces\src\util/regx/Op.hpp(374) : error C2561:
> 'getToken' : function must return a value
>
> I understand that some inline functions are just dummy stubs, but can you
> add also the dummy return value
> to the end of them, like this:
>
> inline int Op::getSize() const {
>     ThrowXML(RuntimeException, XMLExcepts::Regex_NotSupported);
>     return 0
> }
> -------------------------------------------
> Same for process* functions in ParserForXMLSchema.cpp
> -------------------------------------------
> IDNodeIteratorImpl.cpp
> F:\code\Xerces\src\ibmxml\xerces\src\idom\IDNodeIteratorImpl.cpp(71) : fatal
> error C1083: Cannot open include file: 'NodeIteratorImpl.hpp': No such file
> or directory
> IDRangeImpl.cpp
> F:\code\Xerces\src\ibmxml\xerces\src\idom\IDRangeImpl.cpp(62) : fatal error
> C1083: Cannot open include file: 'NodeImpl.hpp': No such file or directory
> IDTreeWalkerImpl.cpp
> F:\code\Xerces\src\ibmxml\xerces\src\idom\IDTreeWalkerImpl.cpp(67) : fatal
> error C1083: Cannot open include file: 'TreeWalkerImpl.hpp': No such file or
> directory
>
> I got rid of these by adding the path to
> F:\code\Xerces\src\ibmxml\xerces\src\dom in my include environment.
> ------------------------------------------
> VCPPDefs.cpp
>
> F:\code\Xerces\src\ibmxml\xerces\src\util/Compilers/VCPPDefs.hpp(177) :
> error C2816: alternative form of 'operator delete' must be a member
> F:\code\Xerces\src\ibmxml\xerces\src\util/Compilers/VCPPDefs.hpp(177) :
> error C2810: second formal parameter for 'operator delete' must be 'unsigned
> int'
>
> Here the code.
> class IDOM_Document;
> inline void operator delete(void* ptr, IDOM_Document *doc)
> {
>     return;
> }
>
> Here is the error explanation :
> Compiler Error C2816
> alternative form of 'operator delete' must be a member
>
> The two-parameter form of the operator delete can be redefined only within a
> class, structure, or union. Global redefinitions of operator delete are
> allowed to have only one parameter.
>
> I just commented that code and it compiled.
> ----------------------------------------------------------
>
> Peter A. Volchek
> Software Engineer
> Metis International, Inc.
> PeterV@ti.com.od.ua
>
> ---------------------------------------------------------------------
> 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