linux - 对于armarm-linux-gnueabi,未定义对 `clock_gettime'的引用

标签 linux arm cross-compiling

我试图使用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/

相关文章:

javascript - 在运行 apache 的 blueonyx 服务器上找不到文件

linux - 自动下载 webkit 源

c - 为什么可能和不太可能的宏对 ARM 汇编代码没有任何影响?

c - ARMv5 上的 libsodium 段错误

Erlang/OTP R13B ARM二进制下载

Win CE 6 的 C 文件编译

linux - 每 1 分钟后重复检查 perforce。

mysql - 将数据库导入 phpMyAdmin (MAMP) 时出现 SQL 语法错误

python - 如何交叉编译Python?

c++ - 用于部署到远程 Linux 主机的命令行的 Qt Creator 标准输入