When compiling multithread programs in eclipse cdt, the pthread library should be configured, it is easy way.
For C project.
1. Project -> Properties -> C/C++ Build -> Settings -> Tool Settings -> GCC C Compiler -> Miscellaneous
add -pthread at the beginning of Other flags.
2. Project -> Properties -> C/C++ Build -> Settings -> Tool Settings -> GCC C Compiler -> Libaries
find the add tag, click add Enter Value pthread
Then click Apply button, click OK button.
That will add pthread library to the CDT environment.
For C++ project, it is the similar way as upper steps.
本文指导如何在Eclipse CDT环境中配置pthread库,适用于C和C++项目,通过设置编译器和其他参数来实现多线程程序的顺利编译。
1729

被折叠的 条评论
为什么被折叠?



