c++0x compiles but eclipse editor errors even with -gnu++0x discovery

前端 未结 2 583
半阙折子戏
半阙折子戏 2020-12-17 19:24

I use some code to report duration of a task using std::chrono::high_resolution_clock ... part of c++0x.

I can successfully compile c++0x features in eclipse cdt usi

2条回答
  •  醉酒成梦
    2020-12-17 19:43

    For chrono in eclipse you should add those symbols

    _GLIBCXX_USE_C99_STDINT_TR1
    

    and

    __cplusplus = 201103L
    

    How to add them:

    Prject properties -> C/C++ General -> Path and Symbols -> Symbols (Tab) -> GNU C++ -> and there click add.

    Remember to add __cplusplus with value 201103L

提交回复
热议问题