错误处理--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的更多相关文章

  1. 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 ...

  2. 在调试C++程序是出现这个问题的解决方案illegal pure syntax, must be '= 0'

    笔者在调试c++的时候遇见了这个问题 E:\Data Struct\SqString\新建 文本文档.cpp(5) : error C2258: illegal pure syntax, must b ...

  3. [转][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 ...

  4. Use Reentrant Functions for Safer Signal Handling(译:使用可重入函数进行更安全的信号处理)

    Use Reentrant Functions for Safer Signal Handling 使用可重入函数进行更安全的信号处理 How and when to employ reentranc ...

  5. c++builder XE7 C++11 C++0x 新语法

    Non-static data member initializers 非静态成员变量初始化变得简单,这个XE7 64位编译成功,32位还是不支持 As a simple example, struc ...

  6. systemtap 2.8 news

    * What's new in version 2.8, 2015-06-17 - SystemTap has improved support for probing golang programs ...

  7. mysql入门与进阶

    MySQL入门与进阶 需求:对一张表中的数据进行增删改查操作(CURD) C:create 创建 U:update 修改 R:read 读|检索 查询 D:delete 删除涉及技术:数据库 1.数据 ...

  8. <Effective C++>读书摘要--Inheritance and Object-Oriented Design<一>

    1.Furthermore, I explain what the different features in C++ really mean — what you are really expres ...

  9. JavaWeb前端笔记

    day06 回顾: bootstrap: css框架,html/css/js集于一身,ie 6/7/8兼容有问题 开发响应式页面,使用于不同的上网设备 使用步骤: 1.导入bootstrap.css ...

随机推荐

  1. ASP.NET MVC4 View层_Razor操作Html元素

    1 常用 Html 标签 1.1 Label Html 语法 :<label for="UserName">用户名</label> Razor语法:@Htm ...

  2. sharepoint 2010 重建遇到的问题

    需要重新安装Sharepoint 2010 ,遇到问题记录下来,sharepoint中安装了热补丁和英文语言包. 卸载: 1.运行配置向导将服务器从服务场中脱离: 2.在管理中心中卸载sharepoi ...

  3. python关于字典的使用方法

    #-*- coding:utf-8 -*-#Author:gxli#定义字典id_db={ 233333199211222342:{ 'name':'xiaoa', 'age':23, 'addr': ...

  4. 老叶观点:MySQL开发规范之我见

    来源:http://ourmysql.com/archives/1396 大多数MySQL规范在网上也都能找得到相关的分享,在这里要分享的是老叶个人认为比较重要的,或者容易被忽视的,以及容易被混淆的一 ...

  5. 20145129 《Java程序设计》第5周学习总结

    20145129 <Java程序设计>第5周学习总结 教材学习内容总结 语法与继承架构 使用try.catch Java中所有错误都会被打包为对象,可以尝试(try)捕捉(catch)代表 ...

  6. “来用”alpha版使用说明书

    1引言 1 .1编写目的 针对我们发布的alpha版本做出安装和使用说明,使参与内测的人员及用户了解软件的使用方法和相关内容. 1 .2参考资料 <c#程序设计基础>,赵敏主编,2011, ...

  7. css3之圆角效果 border-radius

    圆角效果 border-radius  border-radius是向元素添加圆角边框. 使用方法: border-radius:10px; /* 所有角都使用半径为10px的圆角 */ border ...

  8. MVC中使用SignalR打造酷炫实用的即时通讯功能附源码

    前言,现在这世道写篇帖子没个前言真不好意思发出来.本贴的主要内容来自于本人在之前项目中所开发的一个小功能,用于OA中的即时通讯.由于当时走的太急,忘记把代码拿出来.想想这已经是大半年前的事情了,时间过 ...

  9. Jquery获取选中的checkbox的值

    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"% ...

  10. loadrunner-增加检查点(web_reg_find)

    接口性能测试地址: http://192.168.x.x:x/tionWeb/Ajax_GetStock.aspx?stockcode=600571 性能测试脚本: Action() { lr_sta ...