You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Roger Leigh (JIRA)" <ji...@apache.org> on 2018/06/04 14:26:00 UTC

[jira] [Comment Edited] (XALANC-782) Mismatched types when compiling Xalan on Windows with native wchar_t

    [ https://issues.apache.org/jira/browse/XALANC-782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16500286#comment-16500286 ] 

Roger Leigh edited comment on XALANC-782 at 6/4/18 2:25 PM:
------------------------------------------------------------

Xerces-C++ 3.x uses wchar_t by default on Windows, and 3.2.1 can optionally use char16_t with C++11.  Xalan 1.11 works fine with 3.x and wchar_t.  I would update it to support char16_t, but I have yet to hear back from any of the maintainers regarding joining the project.


was (Author: rleigh):
Xerces-C++ 3.x uses wchar_t by default, and 3.2.1 can optionally use char16_t with C++11.  Xalan 1.11 works fine with 3.x and wchar_t.  I would update it to support char16_t, but I have yet to hear back from any of the maintainers regarding joining the project.

> Mismatched types when compiling Xalan on Windows with native wchar_t
> --------------------------------------------------------------------
>
>                 Key: XALANC-782
>                 URL: https://issues.apache.org/jira/browse/XALANC-782
>             Project: XalanC
>          Issue Type: Bug
>    Affects Versions: 1.10
>            Reporter: Hermann Walth
>            Assignee: Steven J. Hathaway
>            Priority: Major
>
> I have the following scenario:
> I built Xerces C++ 2.7 successfully with the flag /Zc:wchar_t set, using Visual Studio 2017.
> If I now try to build Xalan C++ 1.10 with Visual Studio 2017 (by opening and retargeting the provided solution VC7.1/Xalan.sln), I get error messages like the following:
> {code:java}
> C2664: 'void XalanFileOutputStream::write(const char *,unsigned int)': cannot convert argument 1 from 'XMLCh [512]' to 'const UTF16Ch *' (xml-xalan\c\src\xalanc\utils\msgcreator\icureshandler.cpp:89){code}
> The problem here is that XalanFileOutputStream::write expects to be called with an array of XMLCh (which Xerces defines to be native wchar_t), but is actually called with an array of UTF16Ch (which is a type alias of unsigned short). Hence, there is a type error.
> I also get the error
> {code:java}
> C1083: Cannot open include file: 'LocalMsgIndex.hpp': No such file or directory (xml-xalan\c\src\xalanc\xslt\elemtemplateelement.hpp:45)
> {code}
> Is there a way to successfully compile Xalan 1.10 even with the flag /Zc:wchar_t set? I don't want to set this flag because it causes other problems in my codebase, and I updating to Xalan 1.11 and to Xerces 3.x would take some effort because both libraries changed their API without a clear migration guide.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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