1

I am using EzLogger available at http://axter.com/ezlogger/index.htm

I tried to compile the simple example code from that website to test the C++ logger. I have some errors, and I found out that I could compile it with -fpermissive gcc option. Now, I have warning messages like this:

In file included from src/ezlogger_headers.hpp:18,
src/ezlogger.hpp: In static member function ‘static void axter::ezlogger<EZLOGGER_OUTPUT_POLICY, EZLOGGER_FORMAT_POLICY, EZLOGGER_VERBOSITY_LEVEL_POLICY>::log_out(const char*, int, const char*, axter::ext_data, bool, const T&)’:
src/ezlogger.hpp:248: warning: there are no arguments to ‘get_log_stream’ that depend on a template parameter, so a declaration of ‘get_log_stream’ must be available
src/ezlogger.hpp:248: warning: there are no arguments to ‘get_log_prefix_format’ that depend on a template parameter, so a declaration of ‘get_log_prefix_format’ must be available
src/ezlogger.hpp:249: warning: there are no arguments to ‘get_log_stream’ that depend on a template parameter, so a declaration of ‘get_log_stream’ must be available
src/ezlogger.hpp: In static member function ‘static void axter::ezlogger<EZLOGGER_OUTPUT_POLICY, EZLOGGER_FORMAT_POLICY, EZLOGGER_VERBOSITY_LEVEL_POLICY>::log_out(const char*, int, const char*, axter::ext_data, bool, const T1&, const T2&)’:
src/ezlogger.hpp:255: warning: there are no arguments to ‘get_log_stream’ that depend on a template parameter, so a declaration of ‘get_log_stream’ must be available
src/ezlogger.hpp:255: warning: there are no arguments to ‘get_log_prefix_format’ that depend on a template parameter, so a declaration of ‘get_log_prefix_format’ must be available
src/ezlogger.hpp:256: warning: there are no arguments to ‘get_log_stream’ that depend on a template parameter, so a declaration of ‘get_log_stream’ must be available
src/ezlogger.hpp: In static member function ‘static void axter::ezlogger<EZLOGGER_OUTPUT_POLICY, EZLOGGER_FORMAT_POLICY, EZLOGGER_VERBOSITY_LEVEL_POLICY>::log_out(const char*, int, const char*, axter::ext_data, bool, const T1&, const T2&, const T3&)’:
src/ezlogger.hpp:262: warning: there are no arguments to ‘get_log_stream’ that depend on a template parameter, so a declaration of ‘get_log_stream’ must be available
src/ezlogger.hpp:262: warning: there are no arguments to ‘get_log_prefix_format’ that depend on a template parameter, so a declaration of ‘get_log_prefix_format’ must be available
src/ezlogger.hpp:263: warning: there are no arguments to ‘get_log_stream’ that depend on a template parameter, so a declaration of ‘get_log_stream’ must be available

Is there a way to remove the warning messages?

4

1 に答える 1

1

自分の質問に対する答えが見つかったかどうかはわかりません。

まず、C++ 標準の新しいバージョンで何が修正される可能性があるかを示唆する投稿に注目しました。「テンプレート」を持つ複数の基本クラスが使用される場合、メソッドは、そのメソッドがどの基本クラスに属するかを明示的に指定「する必要があります」。投稿では、予約語「this」が使用されます。私の場合、関数は静的であり、get_log_stream などの関数の前に、クラス名の前にコロンを 2 つ付ける必要があります。

于 2012-06-04T14:00:24.117 に答える