Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
要使用clock_gettime我需要链接什么库?我收到clock_gettime未定义的链接器错误。
clock_gettime
尝试链接到librt:
librt
gcc -o myprog myprog.c -lrt
(另请注意,您必须在指定源文件-lrt后放置标志!)myprog.c
-lrt
myprog.c