Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to use log4cxx in Fedora 6 is version 0.97

Shulou Source: shulou.com Published: 2022-06-01 04:50:37 09月24日 Update

This article mainly introduces Fedora 6 how to use log4cxx version 0.97, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor with you to understand.

The version that uses log4cxx is 0. 97, and the OS is Fedora 6. 0. The first problem encountered in the process of make is:

.. / include/log4cxx/xml/domconfigurator.h:249: error: extra qualification

'log4cxx::xml::DOMConfigurator::' on member 'subst'

It took nearly two hours to find the answer to the above question of Fedora 6. The answer is as follows:

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

/ / to change the above function declaration to this protected in the source code:

Helpers::Properties props

Then, when compiling to / tests/src/util/filter.cpp, the prompt "'RegEx' is not declared in this scope" goes into the filter.cpp file and sees that the file uses the regex feature in the boost library.

# include # 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 ());}

The first thing that comes to mind in Fedora 6 is that the "- lboost_regex" was not added when gcc, the compilation option "- lboost_regex" was added to Makfile.in, or the error occurred.

*. Check the source code of the boost library and find that the RegEx function is defined in cregex.hpp instead of regex.hpp. It may be that the boost library has been updated (the RegEx function has been moved to the definition in cregex.hpp), while log4cxx still uses the old boost library by default.

Fedora 6 this error changes the header file to compile OK.

Thank you for reading this article carefully. I hope the article "how to use log4cxx version 0.97 in Fedora 6" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Article version function file compilation source code answer or error value function interest function reason at the same time hour not yet that is time more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB NVidia Huawei vpn Xiaomi