1

我使用 ezlogger 库来记录我们的项目。升级 OSX Maverick 后,我无法编译代码,g++ 编译器在编译日志宏时抛出错误。错误信息:

In file included from ./../ezlogger/ezlogger_headers.hpp:16:
./../ezlogger/ezlogger.hpp:113:29: error: use of undeclared identifier 'get_verbosity_level_tolerance'
                        if (m_verbosity_level <= get_verbosity_level_tolerance())
                                                 ^
./../ezlogger/ezlogger.hpp:118:6: error: use of undeclared identifier 'get_log_stream'
                                        get_log_stream() << Data;
                                        ^
./../ezlogger/ezlogger.hpp:124:29: error: use of undeclared identifier 'get_verbosity_level_tolerance'
                        if (m_verbosity_level <= get_verbosity_level_tolerance())
                                                 ^
./../ezlogger/ezlogger.hpp:129:6: error: use of undeclared identifier 'get_log_stream'
                                        get_log_stream() << func;
                                        ^
./../ezlogger/ezlogger.hpp:135:29: error: use of undeclared identifier 'get_verbosity_level_tolerance'
                        if (m_verbosity_level <= get_verbosity_level_tolerance())
                                                 ^
./../ezlogger/ezlogger.hpp:140:29: error: use of undeclared identifier 'get_verbosity_level_tolerance'
                        if (m_verbosity_level <= get_verbosity_level_tolerance())
                                                 ^
./../ezlogger/ezlogger.hpp:145:29: error: use of undeclared identifier 'get_verbosity_level_tolerance'
                        if (m_verbosity_level <= get_verbosity_level_tolerance())
                                                 ^
./../ezlogger/ezlogger.hpp:151:29: error: use of undeclared identifier 'get_verbosity_level_tolerance'
                        if (m_verbosity_level <= get_verbosity_level_tolerance())
                                                 ^

get_verbosity_level_tolerance()的代码如下:

    struct ezlogger_verbosity_level_policy
    {
            static inline verbosity get_verbosity_level_tolerance(){return set_or_get_verbosity_level_tolerance(true);}
            static void set_verbosity_level_tolerance(verbosity NewValue){set_or_get_verbosity_level_tolerance(false, NewValue);}
    private:
            inline static verbosity initial_verbosity_level(){return log_default_verbosity_level;}
            static verbosity set_or_get_verbosity_level_tolerance(bool GetLevel, verbosity NewValue = log_default_verbosity_level)
            {
                    static verbosity verbosity_level = initial_verbosity_level();
                    if (!GetLevel) verbosity_level = NewValue;
                    return verbosity_level;
            }
    };

有没有想过我们该如何解决这个问题?

4

1 回答 1

1

get_verbosity_level_tolerance()是 struct ezlogger_verbosity_level_policy的成员。

尝试调用ezlogger_verbosity_level_policy::get_verbosity_level_tolerance()而不仅仅是get_verbosity_level_tolerance()

于 2013-11-07T10:50:16.947 回答