VC6下编译log4cpp0.3.5rc1

VC6下编译log4cpp0.3.5rc1
1、下载
到sourceforge的log4cpp项目的主页上下载
下面是网址
http://sourceforge.net/project/showfiles.php?group_id=15190

2、解压到特定目录
3、编译
log4cpp-0.3.5rc1\msvc6\msvc6.dsw
出现

d:\log4cpp-0.3.5rc1\include\log4cpp\priority.hh(65) : error C2258: illegal pure syntax, must be '= 0'
d:\log4cpp-0.3.5rc1\include\log4cpp\priority.hh(65) : error C2252: 'MESSAGE_SIZE' : pure specifier can only be specified for functions
d:\log4cpp-0.3.5rc1\include\log4cpp\threading\msthreads.hh(160) : fatal error C1506: unrecoverable block scoping error

错误提示

解决方法:

出错位置priority.hh

class LOG4CPP_EXPORT Priority {
public:
static const int MESSAGE_SIZE=8;

/ Some other declarations //
};

解决方法

将代码改成

static const int MESSAGE_SIZE;

在priority.cpp 里加一句


#include "PortabilityImpl.hh"
#include <log4cpp priority.hh=""></log4cpp>
#include <cstdlib></cstdlib>

const int log4cpp::Priority::MESSAGE_SIZE=8;

保存重新编译

如果出现*.pch不要rebuild整个工程。单独选中一个工程build就可以了。
生成的结果有静态库,也有动态库,根据自己的需要使用。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值