1、 ubuntu中编译报错:
undefined reference to “pthread_create”
collect2:ld returned 1 exit status
就是:编译器在link的时候找不到其中一个使用库的函数。如果差pthread_create的可以发现在pthread.so中,所以需要添加“-lpthread”编译参数,告诉linker在link的时候使用pthread模块
LINK_FLAGS = -s –WL,-rpath=”./” –lpthread
2、 ubuntu中编译报错:
undefined reference to “clock_gettime”
collect2:ld returned 1 exit status
添加“-lrt”编译参数(library 库)
LINK_FLAGS = -s –WL,-rpath=”./” –lrt