zoukankan      html  css  js  c++  java
  • Boost test vs2013 fatal error C1001

    Boost test vs2013 fatal error C1001

    Boost test库提供了一个用于单元测试的基于命令行界面的测试套件UTF:Unit Test Framework,具有单元测试、检测内存泄露、监控程序运行的功能。根据官网介绍boost支持很多编译器。然而在Visual Studio 2013中使用boost的test模块时会报致命错误,如下图所示:

    输出报错信息如下:

    1>------ Build started: Project: Test, Configuration: Debug Win32 ------

    1>  main.cpp

    1>d:oost_1_70_0oost ype_traitscommon_type.hpp(47): fatal error C1001: An internal error has occurred in the compiler.

    1>  (compiler file 'msc1.cpp', line 1325)

    1>   To work around this problem, try simplifying or changing the program near the locations listed above.

    1>  Please choose the Technical Support command on the Visual C++ 

    1>   Help menu, or open the Technical Support help file for more information

    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

     

    定位到报错文件是common_type.hpp

     

    可以看出是因为CXX11的原因,因为VS2013不支持C++11,要么升级VS2013,打上支持CXX11的补丁,要么使用如下方法:

    所以boost提供了一个宏定义来设置是否支持CXX11:

    BOOST_NO_CXX11_TEMPLATE_ALIASES

    在Project->Properties->C/C++->Preprocessor中设置即可:

     

       在Visual Studio 2013中使用boost的test模块时会报致命错误,是因为VS2013没有完全支持CXX11标准。通过一个宏定义可以在不支持CXX11标准的编译器上继续使用boost.

  • 相关阅读:
    ceph服务日志分析
    ceph 守护进程管理
    ceph 数据一致性检查(scrub)
    ceph osd坏盘更换
    OSD操作(扩容/缩容/换盘/数据重平衡/数据一致性)
    SharePoint REST API 获取文件夹下的项目数
    SharePoint REST API 设置SummaryLength属性
    庄子逍遥哲学的六个主要思想
    详细解说,无人机构造及原理
    如何写好项目规划和方案设计文档
  • 原文地址:https://www.cnblogs.com/opencascade/p/boost_test_error.html
Copyright © 2011-2022 走看看