Simon Elbaz wrote:
Hi,
I am trying to compile xalan c++ 1.10 under mingw using g++, xerces2.8.0
and icu3.2.1.
xerces 2.8.0 and ICU3.2.1 dlls are ready but when compiling xalan c++,
with the following commands:
>cd $XALANCROOT
>runConfigure -p cygwin -c i386-mingw32-gcc -x i386-mingw32-g++ -C
--host=i386-pc-cygwin -m icu -t icu
>make clean; make
I get the following error:
/home/simon/mingw/bin/i386-mingw32-g++ -O -DNDEBUG
-I/mnt/backup_software/icu_mingw/include -Wall -DCYGWIN -D_REENTRANT
-DXALAN_ICU_MSG_LOADER -DXALAN_USE_ICU -c
-I/mnt/backup_software/xml-xalan/c/src
-I/mnt/backup_software/xml-xalan/c/include -I../../nls/include
-I/mnt/backup_software/xerces-c-src_2_8_0/src/
-I/mnt/backup_software/xerces-c-src_2_8_0/include/xercesc
-I/mnt/backup_software/xerces-c-src_2_8_0/include/
-I/mnt/backup_software/icu_mingw/include -o ../../obj/XalanDOMString.o
/mnt/backup_software/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp
/mnt/backup_software/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp:
In function `void xalanc_1_10::doXercesTranscode(const SourceType*,
unsigned int, bool, xalanc_1_10::XalanVector<TargetType,
xalanc_1_10::MemoryManagedConstructionTraits<TargetType> >&, bool, char)
[with SourceType = xalanc_1_10::XalanDOMChar, TargetType = char]':
/mnt/backup_software/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp:1060:
instantiated from here
/mnt/backup_software/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp:880:
error: invalid conversion from `const xalanc_1_10::XalanDOMChar*' to
`const XMLCh*'
/mnt/backup_software/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp:880:
error: initializing argument 1 of `static bool
xercesc_2_8::XMLString::transcode(
const XMLCh*, char*, unsigned int, xercesc_2_8::MemoryManager*)'
/mnt/backup_software/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp:1060:
instantiated from here
/mnt/backup_software/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp:906:
error: invalid conversion from `xalanc_1_10::XalanDOMChar*' to `const
XMLCh*'
/mnt/backup_software/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp:906:
error: initializing argument 1 of `static bool
xercesc_2_8::XMLString::transcode(const XMLCh*, char*, unsigned int,
xercesc_2_8::MemoryManager*)'
/mnt/backup_software/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp:
In function `bool xalanc_1_10::doXercesTranscode(const SourceType*,
unsigned int, bool, xalanc_1_10::XalanVector<TargetType,
xalanc_1_10::MemoryManagedConstructionTraits<TargetType> >&, bool) [with
SourceType = xalanc_1_10::XalanDOMChar, TargetType = char]':
/mnt/backup_software/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp:1095:
instantiated from here
/mnt/backup_software/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp:992:
error: invalid conversion from `const xalanc_1_10::XalanDOMChar*' to
`const XMLCh*'
/mnt/backup_software/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp:992:
error: initializing argument 1 of `static bool
xercesc_2_8::XMLString::transcode(const XMLCh*, char*, unsigned int,
xercesc_2_8::MemoryManager*)'
/mnt/backup_software/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp:
In function `bool xalanc_1_10::doXercesTranscode(const SourceType*,
unsigned int, bool, xalanc_1_10::XalanVector<TargetType,
xalanc_1_10::MemoryManagedConstructionTraits<TargetType> >&, bool) [with
SourceType = char, TargetType = xalanc_1_10::XalanDOMChar]':
/mnt/backup_software/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp:1190:
instantiated from here
/mnt/backup_software/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp:992:
error: invalid conversion from `xalanc_1_10::XalanDOMChar*' to `XMLCh*'
/mnt/backup_software/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp:992:
error: initializing argument 2 of `static bool
xercesc_2_8::XMLString::transcode(const char*, XMLCh*, unsigned int,
xercesc_2_8::MemoryManager*)'
make[1]: *** [../../obj/XalanDOMString.o] Error 1
make[1]: Leaving directory `/mnt/backup_software/xml-xalan/c/src/xalanc'
make: *** [all] Error 2
Thanks for you help
You'll have much better luck getting the head of the Subversion
repository to compile cleanly on mingw.
If you really want to try with Xalan-C 1.10, the fix for this error is
to modify src/xalanc/Include/PlatformDefinitions.hpp as follows:
#if defined(XALAN_USE_NATIVE_WCHAR_T)
typedef wchar_t XalanDOMChar;
#else
// UTF-16 character...
typedef unsigned short XalanDOMChar;
#endif
becomes:
typedef XMLCh XalanDOMChar;
Dave