You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by Haiying Tu <tu...@teamqsi.com> on 2006/04/05 18:19:37 UTC

Why XMLPlatformUtils cannot be initialized?

Thanks Dave.
  I have successfully built Xerces and Xalan.  Looks like I have to update my transorm code as well.  In my application project, I have some code very similar to the "simpleTransform" in the Xalan samples. However, The initial  "XMLPlatformUtils::Initialize();" does not work any more.  
  Looks like I need to change into something like:
   
  XMLPlatformUtils::Initialize(XMLUni::fgXercescDefaultLocale,0,0,0,false);
   
   However,  this gave me LNK 2019 error.  Do I have to build another version with ICU in order to use XMLUni?  Otherwise, how to set the parameters for Initialize()? 
  XMLPlatformUtils::Terminate();
  gave me similar error. 
   
  Many thanks in advance!
   
  haiying
   
  David Bertoni <db...@apache.org> wrote:
   
  The latest Xalan-C sources should build fine with the latest sources of 
Xerces-C. If you're going to build the latest Xalan-C with VC8 using 
Xerces 2.7, you'll need to do two things:

1. Change the Xerces-C link library Xalan-C is using. Look for 
xerces-c_3D.lib and xerces-c_3.lib and change them to xerces-c_2D.lib 
and xerces-c_2.lib.

2. Ensure that wchar_t is treated consistently. You can either treat 
wchar_t as a proper type, or treat is as a typedef. Older versions of 
VC++ treated it as a typedef, but the standard requires it be a proper 
type. You will need to set the option consistently in both the Xerces-C 
and Xalan-C projects. Xalan-C defaults to treating wchar_t as a proper 
type in VC8.

Dave


Re: Why XMLPlatformUtils cannot be initialized?

Posted by Haiying Tu <tu...@teamqsi.com>.
Problem has been solved. I need to include  xerces-c_3.lib instead of xerces-c_2.lib.  Thanks!

Haiying Tu <tu...@teamqsi.com> wrote:    Thanks Dave.
  I have successfully built Xerces and Xalan.  Looks like I have to update my transorm code as well.  In my application project, I have some code very similar to the "simpleTransform" in the Xalan samples. However, The initial  "XMLPlatformUtils::Initialize();" does not work any more.  
  Looks like I need to change into something like:
   
  XMLPlatformUtils::Initialize(XMLUni::fgXercescDefaultLocale,0,0,0,false);
   
   However,  this gave me LNK 2019 error.  Do I have to build another version with ICU in order to use XMLUni?  Otherwise, how to set the parameters for Initialize()? 
  XMLPlatformUtils::Terminate();
  gave me similar error. 
  &nbs p;
  Many thanks in advance!
   
  haiying
   
  David Bertoni <db...@apache.org> wrote:
   
  The latest Xalan-C sources should build fine with the latest sources of 
Xerces-C. If you're going to build the latest Xalan-C with VC8 using 
Xerces 2.7, you'll need to do two things:

1. Change the Xerces-C link library Xalan-C is using. Look for 
xerces-c_3D.lib and xerces-c_3.lib and change them to xerces-c_2D.lib 
and xerces-c_2.lib.

2. Ensure that wchar_t is treated consistently. You can either treat 
wchar_t as a proper type, or treat is as a typedef. Older versions of 
VC++ treated it as a typedef, but the standard requires it be a proper 
type. You will need to set the option consistently in both the Xerces-C 
and Xalan-C projects. Xalan-C defaults to treating wchar_t as a proper 
type in VC8.

Dave