“std_lib_facilities.h” showing error

前端 未结 6 1703
一整个雨季
一整个雨季 2020-12-20 20:03

I am using Codeblocks 17.12 and have already set compiler settings to C++11 standard. I am studying from Bjarne Stroustrup\'s book \"Programming - Principles and Practice us

6条回答
  •  猫巷女王i
    2020-12-20 20:40

    Using the updated header is probably the best solution. For those interested in this particular error: it seems to be caused by

    // disgusting macro hack to get a range checked string:
    #define string String
    

    When is included after this macro, gcc runs into errors. When it is included before, gcc compiles fine. (Note: this macro is enabled only when _MSC_VER<1500; according to comments "MS C++ 9.0" does not get this macro.)

    This is an object lesson on why hacks are not recommended. They break over time.

提交回复
热议问题