Fedora 6使用log4cxx的版本为0.97

系统 Linux
使用log4cxx的版本为0.97 , OS为Fedora 6. 在make的过程中,首先碰到的问题就是: Fedora 6以上问题花了近二个小时,才找到答案, 答案见下

Fedora 6已被广泛应用但是也在不断的更新,这里介绍Fedora 6安装设置使用,帮助大家安装更新Fedora 6系统。花了一晚上时间编译log4cxx, 总算通过了,这鸟工具,整S我了。
  
使用log4cxx的版本为0.97 , OS为Fedora 6.   在make的过程中,首先碰到的问题就是:
../include/log4cxx/xml/domconfigurator.h:249: error: extra qualification
'log4cxx::xml::DOMConfigurator::' on member 'subst'

Fedora 6以上问题花了近二个小时,才找到答案, 答案见下:

  1. Index: include/log4cxx/xml/domconfigurator.h   
  2. ===================================================================   
  3. --- include/log4cxx/xml/domconfigurator.h (revision 384243)   
  4. +++ include/log4cxx/xml/domconfigurator.h (working copy)   
  5. @@ -246,7 +246,7 @@   
  6. protected:   
  7. static LogString getAttribute(apr_xml_elem*,   
  8. const std::string& attrName);   
  9. -LogString DOMConfigurator::subst(const LogString& value);   
  10. +LogString subst(const LogString& value);    

//要在源代码中把以上函数声明改成这句protected:
helpers::Properties props;

然后,编译到 /tests/src/util/filter.cpp 时,提示“‘RegEx’ 在此作用域中尚未声明”进入到filter.cpp文件中,看到该文件使用的是boost库中的regex功能。

  1. #include <boost/regex.hpp> 
  2. #include "filter.h"  
  3. using namespace log4cxx;  
  4. using namespace log4cxx::helpers;  
  5. using namespace boost;  
  6. String Filter::merge(const String& pattern, const String& in, const String& fmt)  
  7. {  
  8. USES_CONVERSION;  
  9. std::string convPattern = T2A(pattern.c_str());  
  10. std::string convIn = T2A(in.c_str());  
  11. std::string convFmt = T2A(fmt.c_str());  
  12.  
  13. std::string result = RegEx(convPattern).Merge(convIn, convFmt);  
  14. return A2T(result.c_str());}  

Fedora 6首先想到的是: gcc的时候“-lboost_regex”没有添加,在Makfile.in中添加编译选项:"-lboost_regex",还是出现该错误。

***,查看boost库源代码,发现RegEx函数定义在cregex.hpp中,而不是regex.hpp中,可能是boost库已经更新(把RegEx函数移到cregex.hpp中定义),而log4cxx却还是默认使用旧boost库的原因。

Fedora 6这个错误更改一下头文件编译就OK了。#include <boost/cregex.hpp>以上两个错误,花起来解决的时间都要4个小时。真是无语了。。。

【编辑推荐】

  1. Fedora 6网络配置设置IP地址
  2. Fedora 6.0蓝牙服务器传送相关配置
  3. Fedora Sun技术开源策略商业化痕迹太过明显
  4. Fedora core 4安装nvidia的显卡驱动
  5. Fedora Moonlight开源实现其目标平台是Linux与Unix/X11系统。
责任编辑:佚名 来源: CSDN
相关推荐

2020-12-20 19:26:20

LVMFedoraLinux

2022-09-06 08:25:18

FedoraLinux

2023-12-11 15:26:42

2021-01-14 09:00:00

开发FedoraUbuntu

2014-10-24 09:55:12

FedoraDocker

2011-11-08 17:05:55

Fedora 16尝试理由

2022-03-04 09:37:09

CXX-QtRust 库Rust 语言

2009-12-15 15:46:23

Fedora平台

2009-12-21 16:21:39

Fedora Core

2009-12-17 09:12:21

Fedora Core

2012-08-01 09:20:14

Fedora 18桌面系统

2011-05-25 09:52:40

Fedora 15

2023-07-31 09:36:07

Linux官方版本

2010-05-25 16:53:47

批量添加IPv6地址

2010-02-25 18:02:06

2010-03-01 17:02:16

Fedora scim

2009-12-23 15:57:27

Fedora GCC

2019-06-21 08:55:45

FedoraRPMLinux

2009-10-26 19:22:29

VB.NET使用Log

2010-02-26 10:11:04

Fedora Core
点赞
收藏

51CTO技术栈公众号