次のアプリケーションでは、最初の行でアクセス違反が発生します。これは何ですか?
// test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <xercesc/util/XMLString.hpp>
using namespace xercesc;
int main()
{
XMLCh* path= XMLString::transcode("test.xml");
return 0;
}
[編集] 次のコードでは XMLFormatTarget 行で例外が発生しますが、文字列を "C:/test.xml" から "test.xml" に変更すると問題なく動作します。
// test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/framework/LocalFileFormatTarget.hpp>
using namespace xercesc;
int main()
{
XMLPlatformUtils::Initialize();
XMLFormatTarget *formatTarget = new LocalFileFormatTarget("C:/test.xml");
return 0;
}