我试图使用arm-lunux-gnueabi交叉编译工具链交叉编译ARM架构的文件。但我收到以下错误:-
undefined reference to `clock_gettime'
请指导我应该包含哪些头文件或库以及如何消除此错误。
我正在使用以下命令进行交叉编译:-
make ARCH=arm CROSS_COMPILE -C /path/to/source
感谢帮助。
最佳答案
作为documentation说:
Note
Most systems require the program be linked with the librt library to use these functions.
因此使用 -lrt
标志链接到 rt 库。
关于linux - 对于armarm-linux-gnueabi,未定义对 `clock_gettime'的引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34591755/