又回到了ubuntu,环境配置自然费了点功夫,然后写个多线程一堆error,解决到最后就剩undefined reference to "pthread_create",于是百度,是没有链接libpthread.so。长期以来,从来没有为这种问题费过神,这在windows下自然有visual studio帮我搞定了。最后,解决方法就是 -pthread
g++ -std=c++11 -o test thread_pool.h primer.h primer.cpp -lpthread
又回到了ubuntu,环境配置自然费了点功夫,然后写个多线程一堆error,解决到最后就剩undefined reference to "pthread_create",于是百度,是没有链接libpthread.so。长期以来,从来没有为这种问题费过神,这在windows下自然有visual studio帮我搞定了。最后,解决方法就是 -pthread
g++ -std=c++11 -o test thread_pool.h primer.h primer.cpp -lpthread