C++ error: undefined reference to 'clock_gettime' and 'clock_settime'

后端 未结 4 424
予麋鹿
予麋鹿 2020-12-02 07:10

I am pretty new to Ubuntu, but I can\'t seem to get this to work. It works fine on my school computers and I don\'t know what I am not doing. I have checked usr/in

4条回答
  •  执笔经年
    2020-12-02 08:05

    Add -lrt to the end of g++ command line. This links in the librt.so "Real Time" shared library.

提交回复
热议问题