Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

xerces-C++的XmlCh是双字节的,但是unix平台的wchar_t是4字节的

7 views
Skip to first unread message

daishu59

unread,
Nov 25, 2010, 6:06:49 AM11/25/10
to
我在solaris平台上使用xerces-C++,发现,xerces自定义的XmlCh是双字节short,而平台上的wchar_t是4个字节的,不能直接用。如果用char的话

XMLPlatformUtils::Initialize();
XMLCh nameStr[100]="abc";
aNode =doc->createElement(nameStr);

编译提示错误:
> sunCC -I/u1/gonl02/bin/xerces-c-3.1.1-sparc-solaris-cc-5.10/include -lutil xml.C
"xml.C", line 12: Error: Cannot use const char[4] to initialize unsigned short[100]

我改如何转换呢?
--

[m [31m※ 来源:·水木社区 http://newsmth.net·[FROM: 60.247.44.*] [m

0 new messages