undefined reference to `shm_unlink'
1、问题描述:
在编译一个程序的时候提示这样的错误:
BLog.cpp:(.text+0x5fc): undefined reference to `shm_unlink'
DBLog.cpp:(.text+0x610): undefined reference to `shm_open'
/home/SCS/install/lib/liblog4cplus.a(timehelper.o): In function `log4cplus::helpers::Time::gettimeofday()':
/mnt/hgfs/07svn/program/SDK/log4plus/log4cplus-1.1.0/log4cplus-1.1.0/src/timehelper.cxx:102: undefined reference to `clock_gettime'
/home/SCS/install/lib/liblog4cplus.a(sleep.o): In function `unix_nanosleep':
/mnt/hgfs/07svn/program/SDK/log4plus/log4cplus-1.1.0/log4cplus-1.1.0/src/sleep.cxx:52: undefined reference to `clock_nanosleep'
collect2: ld 返回 1
2、解决办法
在前面编译的时候还没出错,只是将原来链接的liblog4cplus.so改为liblog4cplus.a,然后编译就出错了,网上搜了一下在需要加上-lrt选项,编译通过了。
3、-lrt
http://www.lehman.cuny.edu/cgi-bin/man-cgi?librt+3
rt库是运行时库,提供了一些额外的函数定义。
undefined reference to `shm_unlink'的更多相关文章
- (转) Qt 出现“undefined reference to `vtable for”原因总结
由于Qt本身实现的机制所限,我们在使用Qt制作某些软件程序的时候,会遇到各种各样这样那样的问题,而且很多是很难,或者根本找不到原因的,即使解决了问题,如果有人问你为什么,你只能回答--不知道. 今天我 ...
- undefined reference to `__android_log_print'
使用android studio 编写NDK代码时出现错误:undefined reference to `__android_log_print' 解决办法: eclipse andro ...
- CentOS 6.5 编译 PHP-7 报错:undefined reference to `libiconv_open 无法编译 PHP libiconv
./configure --with-mysql=/backup/mysql --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zli ...
- Qt - 错误总结 - 在自定义类头文件中添加Q_OBJECT 编译时报错(undefined reference to ‘vtable for xxThread)
错误提示:在添加的QThread子类头文件添加Q_OBJECT时,编译程序,出现"undefined reference to 'vtable for xxThread'"错误提示 ...
- Qt经典出错信息之undefined reference to `vtable for classname
原文链接:Qt经典出错信息之undefined reference to `vtable for classname 这个出错信息太常见了,用过Qt两个月以上的朋友基本上都能自己解决了,因为太经典了, ...
- 解决undefined reference to `__poll_chk@GLIBC_2.16' 错误
出现这个错误,是系统的glibc版本太低了,需要更新 到http://ftp.gnu.org/gnu/glibc/下载新版本的glibc,也不用太高,我选择glibc-2.20.tar.gz 解压 ...
- ubuntu系统下,gsl 库链接问题 -undefined reference to `cblas_xxx`
今天在ubuntu系统下进行程序调试的时候出现以下错误信息: [ %] Linking CXX executable ../test_coco /usr/local/lib/libgsl.so: un ...
- Android APP使用NDK编译后的ffmpeg库出现undefined reference to 'posix_memalign'错误
在android程序中使用NDK编译后的ffmpeg库的时候出现了如下错误: jni/libs/libavutil.a(mem.o): in function av_malloc:libavutil/ ...
- undefined reference to `Spreadsheet::staticMetaObject'
<C++ GUI Qt 4 编程>学习 一.遇到的问题 在学完第4章后,Spreasheet程序也已经写好了.在用 FindDialog 搜索时发现没有效果. 二.解决过程 调试跟踪代码, ...
随机推荐
- Java堆内存不足
1)使用IDEA开发程序时有时候会提示“Java Heap space error”,说明IDEA默认配置的Java堆内存不足,程序需要更多的堆内存. 2)堆(Heap)和非堆(Non-heap)内存 ...
- Java高级架构师(一)第21节:通过X-gen生成商品模块
package com.sishuok.architecture1.goodsmgr.vo; import com.sishuok.architecture1.common.vo.BaseModel; ...
- Android中的动态字符串的处理
1.效果显示 2. MainAcitivity.java package com.example.app2; import android.support.v7.app.AppCompatActivi ...
- python语言实现阶乘的两种方法---递归和迭代
阶乘的递归实现,代码如下: def factorial(n): if n==1: return 1 else: return n*factorial(n-1) number = int(input(& ...
- Java下String和List<String>的互相转换
// List转换为String数组 List<String> list = new ArrayList<String>(); list.add("a1") ...
- 【java】java中直接根据Date 获取明天的时间
展示代码: @Test public void dateTest(){ Date now = new Date(); System.out.println(now); // java.util.Dat ...
- 【jQuery】:not选择器的说明和:checked选择器的使用
1.:not选择器的说明使用 先给出一下例子: $(".form1 :not(input[name='category'])") 这个 能实现 获取到from1表单中除了input ...
- ylbtech-LanguageSamples-ConditionalMethods(条件方法)
ylbtech-Microsoft-CSharpSamples:ylbtech-LanguageSamples-ConditionalMethods(条件方法) 1.A,示例(Sample) 返回顶部 ...
- 接入WebSocket记录 + 一些个人经验
闲扯 WebSocket 以前没用过,之前写过一篇博客是基于原生socket的(查看)比较复杂,慎入.今天另外一个APP需要接websocket了,然后便找到了facebook的 SocketRock ...
- D3.js系列——交互式操作和布局
一.图表交互操作 与图表的交互,指在图形元素上设置一个或多个监听器,当事件发生时,做出相应的反应. 交互,指的是用户输入了某种指令,程序接受到指令之后必须做出某种响应.对可视化图表来说,交互能使图表更 ...