mrkmarron / logpp

An experimental next generation logging framework for JavaScript and fluent.
MIT License
65 stars 0 forks source link

not building on Mac OS X #1

Closed mcollina closed 6 years ago

mcollina commented 6 years ago

Great work on this!

On Node 10.3.0 I'm getting:

In file included from ../nsrc/nlogger.cc:4:
../nsrc/environment.h:35:9: warning: field 'm_formats' will be initialized after field 'm_msgTimeLimit' [-Wreorder]
        m_formats(),
        ^
../nsrc/environment.h:63:19: warning: comparison of integers of different signs: 'int64_t' (aka 'long long') and 'std::__1::vector<std::__1::shared_ptr<MsgFormat>, std::__1::allocator<std::__1::shared_ptr<MsgFormat> > >::size_type' (aka 'unsigned long') [-Wsign-compare]
        if (fmtId == this->m_formats.size())
            ~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~
In file included from ../nsrc/nlogger.cc:6:
../nsrc/formatter.h:67:9: error: use of undeclared identifier 'memcpy_s'
        memcpy_s(this->m_buff + this->m_curr, str.length(), str.c_str(), str.length());
        ^
../nsrc/formatter.h:134:25: error: use of undeclared identifier 'sprintf_s'
        this->m_curr += sprintf_s(this->m_buff + this->m_curr, 32, "%I64i", val);
                        ^
../nsrc/formatter.h:139:18: error: no member named 'isnan' in namespace 'std'
        if (std::isnan(val))
            ~~~~~^
../nsrc/formatter.h:151:18: error: use of undeclared identifier 'floor'
        else if (floor(val) == val)
                 ^
../nsrc/formatter.h:154:29: error: use of undeclared identifier 'sprintf_s'
            this->m_curr += sprintf_s(this->m_buff + this->m_curr, 32, "%I64i", static_cast<int64_t>(val));
                            ^
../nsrc/formatter.h:159:29: error: use of undeclared identifier 'sprintf_s'
            this->m_curr += sprintf_s(this->m_buff + this->m_curr, 32, "%f", val);
                            ^
../nsrc/formatter.h:188:29: error: use of undeclared identifier 'sprintf_s'
            this->m_curr += sprintf_s(this->m_buff + this->m_curr, 32, ".%03dZ", msval);
                            ^
../nsrc/formatter.h:59:9: error: use of undeclared identifier 'memcpy_s'
        memcpy_s(this->m_buff + this->m_curr, N, &str, N);
        ^
../nsrc/formatter.h:141:19: note: in instantiation of function template specialization 'Formatter::emitLiteralString<5>' requested here
            this->emitLiteralString("null");
                  ^
../nsrc/formatter.h:59:9: error: use of undeclared identifier 'memcpy_s'
        memcpy_s(this->m_buff + this->m_curr, N, &str, N);
        ^
../nsrc/formatter.h:207:19: note: in instantiation of function template specialization 'Formatter::emitLiteralString<14>' requested here
            this->emitLiteralString("\"<BadFormat>\"");
                  ^
../nsrc/formatter.h:59:9: error: use of undeclared identifier 'memcpy_s'
        memcpy_s(this->m_buff + this->m_curr, N, &str, N);
        ^
../nsrc/formatter.h:210:19: note: in instantiation of function template specialization 'Formatter::emitLiteralString<8>' requested here
            this->emitLiteralString("\"{...}\"");
                  ^
../nsrc/formatter.h:59:9: error: use of undeclared identifier 'memcpy_s'
        memcpy_s(this->m_buff + this->m_curr, N, &str, N);
        ^
../nsrc/formatter.h:213:19: note: in instantiation of function template specialization 'Formatter::emitLiteralString<16>' requested here
            this->emitLiteralString("\"$rest$\": \"...\"");
                  ^
../nsrc/formatter.h:59:9: error: use of undeclared identifier 'memcpy_s'
        memcpy_s(this->m_buff + this->m_curr, N, &str, N);
        ^
../nsrc/formatter.h:219:19: note: in instantiation of function template specialization 'Formatter::emitLiteralString<6>' requested here
            this->emitLiteralString("\"...\"");
                  ^
../nsrc/formatter.h:59:9: error: use of undeclared identifier 'memcpy_s'
        memcpy_s(this->m_buff + this->m_curr, N, &str, N);
        ^
../nsrc/formatter.h:222:19: note: in instantiation of function template specialization 'Formatter::emitLiteralString<10>' requested here
            this->emitLiteralString("\"<Cycle>\"");
                  ^
../nsrc/formatter.h:59:9: error: use of undeclared identifier 'memcpy_s'
        memcpy_s(this->m_buff + this->m_curr, N, &str, N);
        ^
../nsrc/processingblock.h:96:32: note: in instantiation of function template specialization 'Formatter::emitLiteralString<3>' requested here
                    formatter->emitLiteralString(", ");
                               ^
In file included from ../nsrc/nlogger.cc:6:
../nsrc/formatter.h:59:9: error: use of undeclared identifier 'memcpy_s'
        memcpy_s(this->m_buff + this->m_curr, N, &str, N);
        ^
../nsrc/processingblock.h:183:24: note: in instantiation of function template specialization 'Formatter::emitLiteralString<4>' requested here
            formatter->emitLiteralString(" @ ");
                       ^
In file included from ../nsrc/nlogger.cc:6:
../nsrc/formatter.h:59:9: error: use of undeclared identifier 'memcpy_s'
        memcpy_s(this->m_buff + this->m_curr, N, &str, N);
        ^
../nsrc/processingblock.h:187:24: note: in instantiation of function template specialization 'Formatter::emitLiteralString<7>' requested here
            formatter->emitLiteralString(" from ");
                       ^
In file included from ../nsrc/nlogger.cc:5:
../nsrc/format.h:32:19: warning: private field 'm_formatId' is not used [-Wunused-private-field]
    const int64_t m_formatId; //a unique identifier for the format
                  ^
3 warnings and 16 errors generated.
make: *** [Release/obj.target/nlogger/nsrc/nlogger.o] Error 1
mrkmarron commented 6 years ago

Hmm, that is what I get for publishing x-plat C++ without building on multiple platforms. I did a quick build via WSL to see if I could quickly confirm/fix things and from what I see things should be in much better shape. The only issue that seems odd is the std::isnan. I believe this is a C++11 feature and should be there on clang. @mcollina can you let me know what the compiler/version is. All other items should be fixed but please let me know.

mcollina commented 6 years ago

This now builds fine, I'm just getting this warning:

In file included from ../nsrc/nlogger.cc:5:
../nsrc/format.h:32:19: warning: private field 'm_formatId' is not used [-Wunused-private-field]
    const int64_t m_formatId; //a unique identifier for the format
                  ^
1 warning generated.
  SOLINK_MODULE(target) Release/nlogger.node
+ logpp@0.0.4