How to make CDT/Eclipse work with C++11 threads?

后端 未结 3 2431
予麋鹿
予麋鹿 2021-02-20 01:15

I tried to test an example of C++11 threads in Eclipse. But I got this message when running the program:

terminate called after throwing an instance of \'

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-20 01:57

    The problem was solved by the comment of Jonathan Wakely.

    I added -pthread to C/C++ Build -> Settings -> Tool Settings -> Cross G++ **Linker** -> Miscellaneous -> Other Flags and the program worked correctly.

    Thank you Jonathan.

提交回复
热议问题