There is an even simpler fix. Also this fix you speak of is platform safe
because it is part of the C++ standard.
When you have static data in a class, there must be a separate
outside-the-class initializer statement.
Here goes:
class MacOSUnicodeConverter
{
public:
...
private:
...
static const XMLCh fgMyServiceId[];
};
MacOSUnicodeConverter::fgMyServiceId = { ... };
Note that one need not re-declare all of the static const XMLCh stuff, it's
already been done in the class.
All you need is an assignment statement that assigns whatever value you want
into the variable, which must be resolved with its class name.
HTH!
Matt
-----Original Message-----
From: Patrick Perroud [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 18, 2005 11:11 AM
To: [email protected]
Subject: Re: [MacOS X/CodeWarrior 9.5] XercesLib 2.6 problem
On 18 mai 2005, at 19:00, [EMAIL PROTECTED] wrote:
> I will preface this by saying I have no clue about OS X, but I remember
> reading some changes were made to this code because of some new quirks
> discovered in OS X Unicode support.
> >
I have just tried something that seems to fix it, but I don't know how
other platforms would take it, so I'll leave it to the developers of
XercesLib to decide what to do about it.
In short - in C++, the "static" keyword doesn't have the same meaning
within a class definition (here MacOSUnicodeConverter.hpp) or within
the class implementation (here MacOSUnicodeConverter.cpp).
So - if the header reads:
static const XMLCh fgMyServiceId[]; // Name of the our
unicodeconverter
static const XMLCh fgMacLCPEncodingName[; // Name of the LCPtranscoder
we create
Then the implementation should read:
const XMLCh [] = {
chLatin_M, chLatin_a, chLatin_c, chLatin_O, chLatin_S, chNull
};
const XMLCh MacOSUnicodeConverter::fgMacLCPEncodingName[] = {
chLatin_M, chLatin_a, chLatin_c, chLatin_O, chLatin_S,
chLatin_L
, chLatin_C, chLatin_P, chLatin_E, chLatin_c, chLatin_o,
chLatin_d
, chLatin_i, chLatin_n, chLatin_g, chNull
}
Without the "static" keyword repeated in the implementation.
I did that, and it did fix the issue, indeed: to me, it's a bug of the
2.6 implementation, that should be fixed within next release,
hopefully.
So - every code segment within the project was compiled successfully,
but now I am having a few link errors, all related to SGXMLScanner()
and IGXMLScanner(). I've got 7 of them, and frankly I have no idea what
is it about, so they are all there below. If someone could give me any
direction to have these solved as well, then I think I'll soon get a
MacOX binary framework ;+)
Best regards
Patrick Perroud
- - - -
Link Error : undefined:
'xercesc_2_6::IdentityConstraintHandler::
IdentityConstraintHandler(xercesc_2_6::XMLScanner*,
xercesc_2_6::MemoryManager*)' (code)
Referenced from 'xercesc_2_6::SGXMLScanner::commonInit()' in
SGXMLScanner.cpp
Referenced from 'xercesc_2_6::IGXMLScanner::commonInit()' in
IGXMLScanner.cpp
Link Error : undefined:
'xercesc_2_6::IdentityConstraintHandler::reset()' (code)
Referenced from 'xercesc_2_6::SGXMLScanner::scanReset(const
xercesc_2_6::InputSource&)' in SGXMLScanner.cpp
Referenced from 'xercesc_2_6::IGXMLScanner::scanReset(const
xercesc_2_6::InputSource&)' in IGXMLScanner2.cpp
Link Error : undefined:
'xercesc_2_6::IdentityConstraintHandler::
activateIdentityConstraint(xercesc_2_6::SchemaElementDecl*, int,
unsigned int, const unsigned short*, const
xercesc_2_6::RefVectorOf<xercesc_2_6::XMLAttr>&, unsigned int)' (code)
Referenced from 'xercesc_2_6::SGXMLScanner::scanStartTag(__bool8&)' in
SGXMLScanner.cpp
Referenced from 'xercesc_2_6::IGXMLScanner::scanStartTagNS(__bool8&)'
in IGXMLScanner.cpp
Link Error : undefined: 'xercesc_2_6::XSValue::getActualValue(const
unsigned short*, xercesc_2_6::XSValue::DataType,
xercesc_2_6::XSValue::Status&, xercesc_2_6::XSValue::XMLVersion,
__bool8, xercesc_2_6::MemoryManager*)' (code)
Referenced from 'xercesc_2_6::PSVIItem::getActualValue()const ' in
PSVIItem.cpp
Link Error : undefined: 'xercesc_2_6::XSValue::getDataType(const
unsigned short*)' (code)
Referenced from 'xercesc_2_6::PSVIItem::getActualValue()const ' in
PSVIItem.cpp
Link Error : undefined:
'xercesc_2_6::XSAXMLScanner::XSAXMLScanner(xercesc_2_6::
GrammarResolver*, xercesc_2_6::XMLStringPool*,
xercesc_2_6::SchemaGrammar*, xercesc_2_6::MemoryManager*)' (code)
Referenced from 'xercesc_2_6::TraverseSchema::validateAnnotations()' in
TraverseSchema.cpp
Link Error : undefined:
'xercesc_2_6::IdentityConstraintHandler::
deactivateContext(xercesc_2_6::SchemaElementDecl*, const unsigned
short*)' (code)
Referenced from 'xercesc_2_6::SGXMLScanner::scanEndTag(__bool8&)' in
SGXMLScanner.cpp
Referenced from 'xercesc_2_6::SGXMLScanner::scanStartTag(__bool8&)' in
SGXMLScanner.cpp
Referenced from 'xercesc_2_6::IGXMLScanner::scanStartTagNS(__bool8&)'
in IGXMLScanner.cpp
Referenced from 'xercesc_2_6::IGXMLScanner::scanEndTag(__bool8&)' in
IGXMLScanner.cpp
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
___________________________________________________________________
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure. If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]