错误处理--pure specifier can only be specified for functions
错误处理--pure specifier can only be specified for functions
今天下载了log4cpp的源代码,在VC6下编译时出现错误:
..\..\include\log4cpp/Priority.hh(65) : error C2258: illegal pure syntax, must be '= 0'
..\..\include\log4cpp/Priority.hh(65) : error C2252: 'MESSAGE_SIZE' : pure specifier can only be specified for functions
..\..\include\log4cpp/threading/MSThreads.hh(160) : fatal error C1506: unrecoverable block scoping error
出错的代码位于Priority.hh中,代码为:
static const int MESSAGE_SIZE = 8;
这个错误改起来很简单,只要将这行代码改为:
static const int MESSAGE_SIZE;
然后定位到Priority.cpp文件中,添加以下的代码即可:
const int Priority::MESSAGE_SIZE = 8;
注意一下,如果这行代码没有放在namespace中时,需要在加上namespace,如:
const int log4cpp::Priority::MESSAGE_SIZE = 8;
错误处理--pure specifier can only be specified for functions的更多相关文章
- error C2253: pure specifier or abstract override specifier only allowed on virtual
1.用Visual Studio 2012编译下面代码时出现的错误: #define RTC_DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const T ...
- 在调试C++程序是出现这个问题的解决方案illegal pure syntax, must be '= 0'
笔者在调试c++的时候遇见了这个问题 E:\Data Struct\SqString\新建 文本文档.cpp(5) : error C2258: illegal pure syntax, must b ...
- [转][C++ 11]override and final - write clean and maintainable C++ code
原文: http://arne-mertz.de/2015/12/modern-c-features-override-and-final/ Today I write about a pair of ...
- Use Reentrant Functions for Safer Signal Handling(译:使用可重入函数进行更安全的信号处理)
Use Reentrant Functions for Safer Signal Handling 使用可重入函数进行更安全的信号处理 How and when to employ reentranc ...
- c++builder XE7 C++11 C++0x 新语法
Non-static data member initializers 非静态成员变量初始化变得简单,这个XE7 64位编译成功,32位还是不支持 As a simple example, struc ...
- systemtap 2.8 news
* What's new in version 2.8, 2015-06-17 - SystemTap has improved support for probing golang programs ...
- mysql入门与进阶
MySQL入门与进阶 需求:对一张表中的数据进行增删改查操作(CURD) C:create 创建 U:update 修改 R:read 读|检索 查询 D:delete 删除涉及技术:数据库 1.数据 ...
- <Effective C++>读书摘要--Inheritance and Object-Oriented Design<一>
1.Furthermore, I explain what the different features in C++ really mean — what you are really expres ...
- JavaWeb前端笔记
day06 回顾: bootstrap: css框架,html/css/js集于一身,ie 6/7/8兼容有问题 开发响应式页面,使用于不同的上网设备 使用步骤: 1.导入bootstrap.css ...
随机推荐
- spring 中的两个DaoSupport类的使用对比
可以利用NamedParameterJdbcDaoSupport 已经封装的NamedParameterJdbcTemplate方便的进行sql中参数的初始化工作. 相对于JdbcDaoSupport ...
- ios中怎么样转行大小写
转换大小写:lowercaseString(小写) uppercaseString(大写)
- iOS8 蓝牙设备的重连接(retrieve) Swift实现
今天App写到了蓝牙重连的阶段,以前针对sdk 6.0写的代码,蓝牙设备的回复是通过 - (void)retrievePeripherals:(NSArray *)peripheralUUIDs 然后 ...
- MVC 中的@Html.DropDownList下拉框的使用
MVC 中的下拉框 实现方式,下面为大家介绍一个我自己认为比较好用的实现方式,而二话不说直接上代码: 第一步: 后台代码 //公共的方法 //在每次需要展示下拉框的时候,需要调用一下这个方法 [数据源 ...
- 【转】matlab采样函数
dyaddown 功能:对时间序列进行二元采样,每隔一个元素提取一个元素,得到一个降采样时间序列. 格式: 1.y = dyaddown(x, EVENODD) 当EVENODD=0时,从x中第二个元 ...
- 向Array中添加改进的冒泡排序
改进冒泡思路 如果在某次的排序中没有出现交换的情况,那么说明在无序的元素现在已经是有序了,就可以直接返回了. 改进冒泡实现 Function.prototype.method = function(n ...
- Python科学计算(一)环境简介——Anaconda Python
Anaconda Python 是 Python 科学技术包的合集,功能和 Python(x,y) 类似.它是新起之秀,已更新多次了.包管理使用 conda,GUI基于 PySide,所有的包基本上都 ...
- 6、android 普通日志输出到SD卡
这是本人见过写博文最负责的一个人: http://www.crifan.com/android_try_use_android_logging_log4j_to_output_log_to_sd_ca ...
- 对git认识
Github则是一个基于Git的日益流行的开源项目托管库.它的使用流程不需要联机,可以先将对代码的修改,评论,保存在本机.等上网之后,再实时推送过去.同时它创建分支与合并分支更容易,推送速度也更快,配 ...
- ZOJ 1111 Poker Hands
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1111 A poker hand consists of 5 ca ...