错误处理--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 ...
随机推荐
- hdu 3836 Equivalent Sets
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=3836 Equivalent Sets Description To prove two sets A ...
- hdu 2612 Find a way
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=2612 Find a way Description Pass a year learning in H ...
- Java日期处理类的lenient属性
这个特性很坑爹:@Test public void test() throws ParseException { SimpleDateFormat df = new SimpleDateFormat( ...
- Linux I/O总结
文件流 标准I/O文件流可用于单字节或多字节字符集.流的定向决定了所读写的是单字节还是多字节.流在最初创建时,并没有定向,此时如果在为定向的流上使用多字节I/O函数,那么该流被设置为宽定向的:如果在为 ...
- Python 抓取网页乱码问题 以及EXCEL乱码
import codecs f1=codecs.open('items.json', 'r', encoding='utf-8').read().decode("unicode_escape ...
- QtSpim实现MIPS指令的编写
QtSpim实现MIPS指令的编写 由于各种对齐问题,cnblogs的格式难以控制,故贴图片,谅解.
- DataGridView控件
DataGridView控件 DataGridView是用于Windows Froms 2.0的新网格控件.它可以取代先前版本中DataGrid控件,它易于使用并高度可定制,支持很多我们的用户需要的特 ...
- asp.net页面的请求处理响应的过程描述
概述 本篇博客从IIS到asp.net页面后台运行完,整个过程做一个简单的描述,如果有不对的地方,望指出. IIS处理请求的过程 我们通过浏览器(Socket客户端)访问一个IIS服务器上的网页时,该 ...
- JavaScript 异常
转载自:http://www.cnblogs.com/aqbyygyyga/archive/2011/10/29/2228824.html(排版格式修改了一下) 一.错误处理的重要性 以前,javas ...
- MyEclipse2015 编写js报 'Calculating completion proposals..' has encountered a problem.
前言:编写js(按点后)弹出这个鬼东西,百度不到..估计是破解有问题.只有换版本了. 版本:MyEclipse 2015 stable 1.0 详细错误信息 解决:换成2.0版本