下面这个错误通常是因为链接选项里漏了-lrt,但有时发现即使加了-lrt仍出现这个问题,使用nm命令一直,会发现-lrt最终指向的文件 没有包含任何symbol,这个时候,可以找相应的静态库版本librt.a,看看它里面是否存在`clock_gettime'。
 
/data1/mooon/run/lib/libsys.a(lock.o): In function `sys::CLock::timed_lock(unsigned int)':
/data1/mooon/src/common_library/src/sys/./lock.cpp:101: undefined reference to `clock_gettime'
/data1/mooon/run/lib/libsys.a(event.o): In function `sys::CEvent::timed_wait(sys::CLock&, unsigned int)':
/data1/mooon/src/common_library/src/sys/./event.cpp:56: undefined reference to `clock_gettime'
 
提示:使用/usr/lib/x86_64-linux-gnu/librt.a替代-lrt,32位系统路径可能是/usr/lib
/i386-linux-gnu/librt.a,注意/usr/lib/i386-linux-gnu/librt.a可能需要放在链接选项的最后,不在可能依然,因为静态库间是有依赖关系的。

[转] undefined reference to `clock_gettime'的更多相关文章

  1. undefined reference to `clock_gettime

    下面这个错误通常是因为链接选项里漏了-lrt,但有时发现即使加了-lrt仍出现这个问题,使用nm命令一直,会发现-lrt最终指向的文件没有包含任何symbol,这个时候,可以找相应的静态库版本libr ...

  2. redis2.3.7安装时出现undefined reference to `clock_gettime'

    (转自:http://blog.csdn.net/qq_28779503/article/details/54844988) undefined reference to `clock_gettime ...

  3. Linux嵌入式学习-Mplayer交叉编译-undefined reference to `clock_gettime' MPlayer

    編譯Mplayera. 配置.configure# ./configure --host-cc=gcc --cc=arm-linux-gcc --target=arm --enable-static ...

  4. undefined reference to `clock_gettime'编译错误的解决办法

    解决办法如下

  5. libQt5Core.so: undefined reference to `dlclose@GLIBC_2.4'

    /******************************************************************************** * libQt5Core.so: u ...

  6. undefined reference to `shm_unlink'

    1.问题描述: 在编译一个程序的时候提示这样的错误: BLog.cpp:(.text+0x5fc): undefined reference to `shm_unlink'DBLog.cpp:(.te ...

  7. 安装sphinx报错(undefined reference to `libiconv_open' 、undefined reference to `libiconv'、undefined reference to `libiconv_close'、make[1]: *** No rule to make target `all'. Stop. 、make: *** [all-recursive

    (为知笔记copy过来格式有变,希望对遇到此问题的童鞋有帮助) 具体错误: Thank you for choosing Sphinx! [root@vm-vagrant csft-4.1]# mak ...

  8. (转) Qt 出现“undefined reference to `vtable for”原因总结

    由于Qt本身实现的机制所限,我们在使用Qt制作某些软件程序的时候,会遇到各种各样这样那样的问题,而且很多是很难,或者根本找不到原因的,即使解决了问题,如果有人问你为什么,你只能回答--不知道. 今天我 ...

  9. undefined reference to `__android_log_print'

    使用android studio 编写NDK代码时出现错误:undefined reference to `__android_log_print' 解决办法: eclipse       andro ...

随机推荐

  1. HDU2586---How far away ?(lca算法)

    Problem Description There are n houses in the village and some bidirectional roads connecting them. ...

  2. 微信小程序利用canvas生成海报分享图片

    一 . 效果 这是借用女神照生成的分享的海报,图片来自网络. 新增了poster组件和更新图片自适应 二 . 准备 准备两张图片连接,最好是自己开发账号验证的https图片链接. 三 . 实现思路 其 ...

  3. 巧用Wget快速建立文件下载中心

    Wget基本用法:1) 从网上下载单个文件 wget http://www.freehao123.com/file.iso 2) 下载一个文件,但以不同的名字存为本地文件 wget –output-d ...

  4. 7、Appium常用API

    嗯,官网已经介绍的很全了.会选几个常用API后期整理. Appium常用API地址:http://appium.io/docs/cn/writing-running-appium/appium-bin ...

  5. centos_mysql踩坑

    1 mysql安装 a: #wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm b:rpm -ivh mysq ...

  6. 36-Ubuntu-用户管理-01-新建用户useradd

    创建用户/设置密码/删除用户/确认用户信息 序号 命令 作用 说明 01 sudo useradd -m -g 组名 新建用户名 添加新用户 -m 自动建立用户家目录 -g 指定用户所在的组,否则会建 ...

  7. C# 获取系统开机时间

    原文:C# 获取系统开机时间 ///         ///  获取系统开机时间          ///         ///         private DateTime GetComput ...

  8. python代码技巧总结(更新至17条)

    怎么提高代码水平?答:看牛逼的代码! 牛逼的代码怎么写的?简单,明确,优雅! 怎么简单,明确,优雅?学技巧! 下面搜罗了一些有才格子褂青年的总结,哈哈 1.检查 Python 中的对象 调用 dir( ...

  9. debug breakpoint with maven in eclipse

  10. whatis - 在 whatis 数据库里查找完整的单词

    总览 (SYNOPSIS) whatis keyword ... 描述 (DESCRIPTION) whatis 命令在一些特定的包含系统命令的简短描述的数据库文件里查找关键字, 然后把结果送到标准输 ...