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
#include
const int log4cpp::Priority::MESSAGE_SIZE=8;
保存重新编译
如果出现*.pch不要rebuild整个工程。单独选中一个工程build就可以了。
生成的结果有静态库,也有动态库,根据自己的需要使用。
本文介绍了在VC6下编译log4cpp0.3.5rc1的步骤,包括下载、解压和编译。编译时出现错误提示,给出了相应的解决方法,如修改priority.hh代码、在priority.cpp里添加语句等。还提到若出现*.pch,单独选中一个工程build即可,生成结果有静态和动态库。
983

被折叠的 条评论
为什么被折叠?



