c++ - 在 VS2008 中编译 boost property_tree 给出 fatal error C1001

标签 c++ visual-studio-2008 boost

这里是windows7下用VS2008编译的代码,

using boost::property_tree::ptree;
ptree   pt;

pt.add("License.Unalterable.Signed.Guid", m_Guid);
pt.add("License.Unalterable.Signed.CustomerId", m_CustomerId);
pt.add("License.Unalterable.Signed.Name", m_Name);
pt.add("License.Unalterable.Signed.Version", m_version);

std::ostringstream oss;
write_xml(oss, pt); // error happened on this function

Then error C1001: An internal error has occurred in the compiler 由 VS2008 给出。

错误详细信息是:

Problem signature:
  Problem Event Name:   APPCRASH
  Application Name: cl.exe
  Application Version:  15.0.30729.1
  Application Timestamp:    488ef6ea
  Fault Module Name:    c1xx.dll
  Fault Module Version: 15.0.30729.1
  Fault Module Timestamp:   488f296d
  Exception Code:   c0000005
  Exception Offset: 0004a085
  OS Version:   6.1.7601.2.1.0.256.4
  Locale ID:    1033

搜索这个问题后,一个link找到了,但我还没有找到修复。

最佳答案

这个问题无法回答。

首先,ICE 总是错误,应该报告给编译器供应商,而不是在 stackoverflow 上。

其次,您的代码不完整。显然,我们无法编译您的代码并期望得到相同的错误(即使没有帮助)。

所以,这是我在黑暗中拍摄的照片:你有没有 #include <sstream> ?

查看 Live On Coliru

#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <sstream>

int main()
{
    using boost::property_tree::ptree;
    ptree   pt;

    std::string m_Guid, m_CustomerId, m_Name, m_version;

    pt.add("License.Unalterable.Signed.Guid", m_Guid);
    pt.add("License.Unalterable.Signed.CustomerId", m_CustomerId);
    pt.add("License.Unalterable.Signed.Name", m_Name);
    pt.add("License.Unalterable.Signed.Version", m_version);

    std::ostringstream oss;
    write_xml(oss, pt);
}

关于c++ - 在 VS2008 中编译 boost property_tree 给出 fatal error C1001,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25800020/

相关文章:

c++ - 没有匹配函数调用 'Book::Book()'

visual-studio-2008 - R6034 : An application has made an attempt to load the C runtime library incorrectly

c++ - boost.graph 1.56.0 和 g++ 4.6.4 编译错误

C++ SetConsoleTextAttribute 更改字符串中的字符

C++内存泄漏与否

c++ - DirectX::SpriteFont/SpriteBatch 阻止绘制 3D 场景

visual-studio - 在 Visual Studio 中调试期间是否有显示程序集的设置?

c - 在 VC++ 中正确实现 Dll 和库

c++ - std::vector 在 move 元素时做额外的操作

c++ - 重新连接设备后 boost::asio::serial_port 读取