1、In Eclipse, you should add string pthread.
2、Project -> Properties -> C/C++ Build -> Settings -> Tool Settings -> GCC Linker -> Libraries -> Libraries (-l) -> Add -> pthread
3、After this Build your project.
https://stackoverflow.com/questions/9803145/undefined-reference-to-pthread-create