久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

Fedora 6怎么使用log4cxx的版本為0.97

159次閱讀
沒有評論

共計(jì) 1644 個字符,預(yù)計(jì)需要花費(fèi) 5 分鐘才能閱讀完成。

這篇文章主要介紹了 Fedora 6 怎么使用 log4cxx 的版本為 0.97,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓丸趣 TV 小編帶著大家一起了解一下。

使用 log4cxx 的版本為 0.97 , OS 為 Fedora 6.  在 make 的過程中,首先碰到的問題就是:
../include/log4cxx/xml/domconfigurator.h:249: error: extra qualification
log4cxx::xml::DOMConfigurator:: on member subst

Fedora 6 以上問題花了近二個小時,才找到答案, 答案見下:

Index: include/log4cxx/xml/domconfigurator.h =================================================================== --- include/log4cxx/xml/domconfigurator.h (revision 384243) +++ include/log4cxx/xml/domconfigurator.h (working copy) @@ -246,7 +246,7 @@ protected: static LogString getAttribute(apr_xml_elem*, const std::string  attrName); -LogString DOMConfigurator::subst(const LogString  value); +LogString subst(const LogString  value);

// 要在源代碼中把以上函數(shù)聲明改成這句 protected:
helpers::Properties props;

然后,編譯到 /tests/src/util/filter.cpp 時,提示“‘RegEx’在此作用域中尚未聲明”進(jìn)入到 filter.cpp 文件中,看到該文件使用的是 boost 庫中的 regex 功能。

#include  boost/regex.hpp  #include  filter.h  using namespace log4cxx; using namespace log4cxx::helpers; using namespace boost; String Filter::merge(const String  pattern, const String  in, const String  fmt) { USES_CONVERSION; std::string convPattern = T2A(pattern.c_str()); std::string convIn = T2A(in.c_str()); std::string convFmt = T2A(fmt.c_str()); std::string result = RegEx(convPattern).Merge(convIn, convFmt); return A2T(result.c_str());}

Fedora 6 首先想到的是:gcc 的時候“-lboost_regex”沒有添加,在 Makfile.in 中添加編譯選項(xiàng):-lboost_regex , 還是出現(xiàn)該錯誤。

***,查看 boost 庫源代碼,發(fā)現(xiàn) RegEx 函數(shù)定義在 cregex.hpp 中,而不是 regex.hpp 中,可能是 boost 庫已經(jīng)更新(把 RegEx 函數(shù)移到 cregex.hpp 中定義),而 log4cxx 卻還是默認(rèn)使用舊 boost 庫的原因。

Fedora 6 這個錯誤更改一下頭文件編譯就 OK 了。

感謝你能夠認(rèn)真閱讀完這篇文章,希望丸趣 TV 小編分享的“Fedora 6 怎么使用 log4cxx 的版本為 0.97”這篇文章對大家有幫助,同時也希望大家多多支持丸趣 TV,關(guān)注丸趣 TV 行業(yè)資訊頻道,更多相關(guān)知識等著你來學(xué)習(xí)!

正文完
 
丸趣
版權(quán)聲明:本站原創(chuàng)文章,由 丸趣 2023-08-25發(fā)表,共計(jì)1644字。
轉(zhuǎn)載說明:除特殊說明外本站除技術(shù)相關(guān)以外文章皆由網(wǎng)絡(luò)搜集發(fā)布,轉(zhuǎn)載請注明出處。
評論(沒有評論)
主站蜘蛛池模板: 无锡市| 封丘县| 肃南| 郴州市| 辽中县| 明溪县| 屏边| 高邑县| 景谷| 武胜县| 葫芦岛市| 搜索| 云浮市| 体育| 尤溪县| 合山市| 龙岩市| 昭通市| 三明市| 涟源市| 汽车| 阳原县| 环江| 长治市| 江华| 博客| 子长县| 武鸣县| 永修县| 海门市| 辽宁省| 威信县| 电白县| 沧源| 陆川县| 新民市| 当阳市| 涟水县| 太康县| 普洱| 吉林省|