错误处理--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. hdu 5233 Gunner II

    原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=5233 简单题,stl水之... #include<algorithm> #include& ...

  2. centos php-fpm nginx配置

    移除旧的软件包:yum remove httpd* php* 安装:yum install php php-fpm yum install php-gd php-mysql php-mbstring ...

  3. AOP在 .NET中的七种实现方法

    7Approaches for AOP in .Net AOP在 .NET中的七种实现方法 Here are all the ways that I can think of to add AOPto ...

  4. EntityFramwork(1) 源地址https://msdn.microsoft.com/zh-cn/data/jj193542

    1.创建应用程序 简单起见,我们将构建一个使用 Code First 执行数据访问的基本控制台应用程序. 打开 Visual Studio "文件"->"新建&qu ...

  5. P2763: [JLOI2011]飞行路线

    然而WA了呀,这道分层图,也是不明白为什么WA了=-= ; maxn=; points=; type node=record f,t,l:longint; end; var n,m,k,i,j,u,v ...

  6. My mac cannot run 类相关的操作 , which is lower than 类相关的操作。

     首先你选择的项目是mac项目,    其次,你MAC的系统版本小于你当前项目部署环境的最低支持版本    要么升级你的MAC系统,要么再project—>target设置developerme ...

  7. Windows下安装Cygwin

    1.去官网下载Cygwin http://www.cygwin.com/ 注意32位和64位的选择,完了直接点击exe文件开始安装. 2.安装 (1)“下一步”: (2)“Install form I ...

  8. matlab 画不同图案的柱状图

    function applyhatch(h,patterns,colorlist) %APPLYHATCH Apply hatched patterns to a figure % APPLYHATC ...

  9. 团队项目——二手书店(NABC分析)

    特色:可发布 N:登陆用户可自行发布售书信息,为学生提供一个网上交易旧书的平台. A:后台数据库管理,对于新登陆的用户信息加以整合,统一发布. B:想出手旧书的学生可从中获取不小的利益,而且也可以实现 ...

  10. git manual

    git init                                                  # 初始化本地git仓库(创建新仓库) git config --global us ...