Hi! Here is all the modifications I've currently made to xalan to try to
make it
compile with Borland C++ Builder 5.
Started with fresh CVS sources the 2001-07-12 10:00 GMT+1
Made a copy of VCPPDefinitions.hpp in BCPPDefinitions.hpp
Modification of PlatformDefinitions.hpp :
> 61: #if defined (__BORLANDC__)
> 62: #include "BCPPDefinitions.hpp"
> 63: #elif defined(_MSC_VER)
Let's start by compiling the XSLT Project
==========================================================================
The project XSLT is imported with the borland conversion utility
(removed 'MFC Compatibility' option like in xerces)
Here is the detail of the each (useful) compilation I have made :
---- compilation of XSLT, 1st try ----------------------------------------
Fail on the first XDomString's use :
[C++ Error] XSLException.hpp(89): E2285 Could not find a match for
'XalanDOMString::XalanDOMString(wchar_t *)'
Added to BCPPDefinitions.hpp :
#define XALAN_XALANDOMCHAR_USHORT_MISMATCH
---- compilation of XSLT, 2nd try ----------------------------------------
[C++ Error] AVT.cpp(384): E2285 Could not find a match for 'substring(const
unsigned short *,const unsigned int &)'
replaced in AVT.cpp (384) :
< return substring(theName, DOMServices::s_XMLNamespaceWithSeparatorLength);
> return substring(theName, (unsigned
int)DOMServices::s_XMLNamespaceWithSeparatorLength);
---- compilation of XSLT, 3rd try ----------------------------------------
[C++ Error] ExtensionFunctionHandler.cpp(156): E2094 'operator!=' not
implemented in type
'__rwstd::__rb_tree<XalanDOMString,XalanDOMString,__rwstd::__ident<XalanDOMS
tring,XalanDOMString>,std::less<XalanDOMString>,std::allocator<XalanDOMStrin
g> >::iterator'
for arguments of type
'__rwstd::__rb_tree<XalanDOMString,XalanDOMString,__rwstd::__ident<XalanDOMS
tring,XalanDOMString>,std::less<XalanDOMString>,std::allocator<XalanDOMStrin
g> >::const_iterator'
replaced in ExtensionFunctionHandler.cpp (156) :
< return m_functions.find(function) != m_functions.end();
> return ( (StringSetType::const_iterator) m_functions.find(function) ) !=
m_functions.end();
---- compilation of XSLT, 4th try ----------------------------------------
same than 3rd try but in ExtensionNSHandler.cpp(200)
---- compilation of XSLT, 5th try ----------------------------------------
same than 3rd try but in NamespacesHandler.cpp(366)
---- compilation of XSLT, 6th try ----------------------------------------
again same type of error
[C++ Error] NamespacesHandler.cpp(366): E2094 'operator!=' not implemented
in type
'__rwstd::__rb_tree<XalanDOMString,XalanDOMString,__rwstd::__ident<XalanDOMS
tring,XalanDOMString>,std::less<XalanDOMString>,std::allocator<XalanDOMStrin
g> >::iterator'
for arguments of type
'__rwstd::__rb_tree<XalanDOMString,XalanDOMString,__rwstd::__ident<XalanDOMS
tring,XalanDOMString>,std::less<XalanDOMString>,std::allocator<XalanDOMStrin
g> >::const_iterator'
replaced in NamespacesHandler.cpp(366) :
< || m_extensionNamespaceURIs.find(theURI) != m_extensionNamespaceURIs.end()
> ||
(ExtensionNamespaceURISetType::const_iterator)m_extensionNamespaceURIs.find(
theURI) != m_extensionNamespaceURIs.end()
---- compilation of XSLT, 7th try ----------------------------------------
[C++ Error] XSLTEngineImpl.hpp(174): E2451 Undefined symbol 'clock_t'
Added to BCPPDefinitions.hpp :
> #include <ctime>
> typedef std::clock_t clock_t;
> #define clock() std::clock()
---- compilation of XSLT, 8th try ----------------------------------------
[C++ Error] ArenaBlock.hpp(131): E2045 Destructor name must match the class
name
template<class ObjectType>
class ArenaBlockDestroy
{
public:
void
operator()(ObjectType& theObject) const
{
theObject.ObjectType::~ObjectType();
}
};
????????????????????????????????????????????????????????
????????????? Don't know how to correct that ???????????????
????????????????????????????????????????????????????????
So I put it in comment for now.
---- compilation of XSLT, 9th try ----------------------------------------
[C++ Error] XSLTEngineImpl.cpp(1652): E2285 Could not find a match for
'substring(const XalanDOMString,const unsigned int &)'
[C++ Error] XSLTEngineImpl.cpp(2618): E2285 Could not find a match for
'substring(const XalanDOMString,const unsigned int &)'
replaced in XSLTEngineImpl.cpp (1652):
prefix = substring(aname, DOMServices::s_XMLNamespaceWithSeparatorLength);
by
prefix = substring(aname, (unsigned
int)DOMServices::s_XMLNamespaceWithSeparatorLength);
replaced in XSLTEngineImpl.cpp (2618):
substring(aname, DOMServices::s_XMLNamespaceWithSeparatorLength) :
XalanDOMString();
by
substring(aname, (unsigned
int)DOMServices::s_XMLNamespaceWithSeparatorLength) : XalanDOMString();
---- compilation of XSLT, 10th try ----------------------------------------
Ok just need to link now
==========================================================================
Oups forget dependencies so we will come back later
==========================================================================
Let's compile in the right order :
1 ==== XalanDOM ====
OK
2 ==== PlatformSupport ====
Added WIN32_LEAN_AND_MEAN in project's conditional defines
DOMStringHelper.cpp (1549)
< unsigned int theCharsWritten = sprintf(theBuffer, "%f", theDouble);
> unsigned int theCharsWritten = std::sprintf(theBuffer, "%f", theDouble);
XalanFileOutputStream.cpp (88)
< c_wstr(theFileName),
> (wchar_t*)c_wstr(theFileName),
3 ==== DOMSupport ====
OK
4 ==== XMLSupport ====
FormatterToText.cpp(112)
< m_encoding( isEmpty(encoding) == false ? encoding :
XalanDOMString(XalanTranscodingServices::s_utf8String) ),
> m_encoding( (isEmpty(encoding) == false ? encoding :
XalanDOMString(XalanTranscodingServices::s_utf8String)) ),
FormatterToXML.cpp(122)
< m_encoding( isEmpty(encoding) == false ? encoding :
XalanDOMString(XalanTranscodingServices::s_utf8String)),
> m_encoding( (isEmpty(encoding) == false ? encoding :
XalanDOMString(XalanTranscodingServices::s_utf8String))),
5 ==== XPath ====
ResultTreeFrag.cpp(87)
< m_children(deepClone == false ? theSource.m_children : NodeVectorType())
> m_children( (deepClone == false ? theSource.m_children :
NodeVectorType()) )
6 ==== XercesParserLiaison ====
OK
7 ==== XalanSourceTree ====
OK
8 ==== XalanExtensions ====
OK
9 ==== XSLT again ====
(see above)
10 ==== XalanTransformer ====
[Linker Error] Unresolved external 'NodeSorter::~NodeSorter()' referenced
from C:\XML-XALAN\C\BUILD\WIN32\VC6\RELEASE\XALANTRANSFORMER\XALANCAPI.OBJ
Strange because XSLT.lib is included
11 ==== TestXSLT ====
[Linker Error] Unresolved external 'NodeSorter::~NodeSorter()' referenced
from C:\XML-XALAN\C\BUILD\WIN32\VC6\RELEASE\XALANTRANSFORMER\XALANCAPI.OBJ
Strange because XSLT.lib is included
Maybe it's cause by the problem in XSLT try 8
==========================================================================
Seems all for now !
Just one more question :
Did you use the xerces CVS version to compile xalan ?
Here I've used the 1.4 xerces version.
Thanks again for your help.
Christophe PARIS
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 11, 2001 7:34 PM
Subject: Re: Compilation under Borland C++ Builder 5
>
> Hi Christophe,
>
> A couple of things:
>
> 1. Did adding XALAN_XALANDOMCHAR_USHORT_MISMATCH solve any problems?
>
> 2. It looks like you're working from older source code. Did you get
the
> latest from CVS to do the port, or are you working from the 1.1 code?
> If you haven't gotten the latest, it will be much easier if you do
that.
> It makes diagnosing problems easier, and means that we can integrate
the
> changes much more quickly/
>
> 3. There are some #defines that we should be able to get rid of from
the
> Borland header file, but for the time being, a copy of the Visual C++
> one is just find.
>
> Now, as far as the error is concerned -- there should be no problem with
> finding a match for that function. A couple of things to try:
>
> 1. Try adding:
>
> #include <PlatformSupport/DOMStringHelper.hpp>
>
> with the other PlatformSupport includes. This shouldn't be necessary,
> but it's worth a try.
>
> 2. I have a feeling the Borland compiler is confused. It should be
> matching the following substring() overload in DOMStringHelper.hpp:
>
> XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)
> substring(
> const XalanDOMString& theString,
> unsigned int theStartIndex,
> unsigned int theEndIndex = unsigned(-1));
>
> Try the following two variations and see if one of them fixes the
> problem:
>
> 225: if (startsWith(theName, DOMServices::s_XMLNamespaceWithSeparator)
== true)
> 226: {
> 227: thePrefix = substring(theName,
DOMServices::s_XMLNamespaceWithSeparatorLength, unsigned(-1));
> 228: }
>
> 225: if (startsWith(theName, DOMServices::s_XMLNamespaceWithSeparator)
== true)
> 226: {
> 227a: unsigned int theStartIndex =
DOMServices::s_XMLNamespaceWithSeparatorLength;
> 227b
> 227c: thePrefix = substring(theName, theStartIndex);
> 228: }