g++ -g:加调试信息 -o:指定输出文件 -std=c++11 指定c++11 -lpthread 多线程库 需要加在-o后面,否则还是会提示undefined reference to `pthread_create’。