【问题标题】:Boost lexical_cast<std::string>(int) MSVC 2008 bug提升 lexical_cast<std::string>(int) MSVC 2008 错误
【发布时间】:2014-09-12 11:54:25
【问题描述】:

我想使用 VC++2008 试用 Apache Thrift,但遇到了无法预料的问题。在调试构建中,我在 VC++ 运行时库中收到错误 "string iterators incompatible"。我追踪到了对boost::lexical_cast&lt;std::string&gt;(int) 的调用,并能够在一个简单的测试程序中触发该错误。

以下因提到的迭代器错误而失败(这是 boost 1.55):

std::string test = boost::lexical_cast<std::string>(5);

在具有正确行为的发布版本中一切正常。并且由于某种原因,这一行仅在节俭代码中失败,并且在最小的测试程序中工作。

我已经尝试将_HAS_ITERATOR_DEBUGGING 设置为 0,但这没有任何效果,因为调试运行时库是使用此标志集编译的。即使在调试版本中,我也尝试选择发布多线程运行时 dll,但这并没有导致使用发布 dll。这甚至是一个坏主意,因为我使用链接到调试运行时 dll 的其他 boost 编译库。

我的想法已经用完了,我可以尝试解决这些问题吗?

【问题讨论】:

    标签: c++ visual-c++ boost


    【解决方案1】:

    问题是因为调试版本使用了 thrift 发布模式库。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多