$ echo | g++ -v -x c++ -E -
$ echo | gcc -v -x c++ -E -
线程库, 如果是linux系统, 编译时需要添加链接选项, 不然会报找不到pthread函数
-lpthread -pthread
add_compile_options(-pthread)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
需要添加
-fcommon
编译选项
Compile old C code (on Linux) that throws errors (Multiply defined) with modern gcc? [closed]
定时器, macintosh中没有定时器, 可以使用线程实现
timer_create
timer_getoverrun
timer_gettime
timer_settime
timer_delete