snmp-query-engine icon indicating copy to clipboard operation
snmp-query-engine copied to clipboard

Fail to compile with msgpack for C/C++ Version 2.1.5

Open fmgdias opened this issue 8 years ago • 5 comments

cc -c -Wall -Wno-unused-function -Werror -O3 -g -I/usr/local/include -I/opt/local/include -o util.o util.c
util.c:16:17: error: use of undeclared identifier 'MSGPACK_OBJECT_RAW'; did you mean 'MSGPACK_OBJECT_MAP'?
        if (o->type != MSGPACK_OBJECT_RAW)
                       ^~~~~~~~~~~~~~~~~~
                       MSGPACK_OBJECT_MAP
/usr/local/include/msgpack/object.h:38:5: note: 'MSGPACK_OBJECT_MAP' declared here
    MSGPACK_OBJECT_MAP                  = 0x07,
    ^
util.c:19:20: error: no member named 'raw' in 'msgpack_object_union'
        s = malloc(o->via.raw.size + 1);
                   ~~~~~~ ^
util.c:21:48: error: no member named 'raw' in 'msgpack_object_union'
                croak(1, "object_strdup: malloc(%d)", o->via.raw.size + 1);
                                                      ~~~~~~ ^
util.c:22:19: error: no member named 'raw' in 'msgpack_object_union'
        memcpy(s, o->via.raw.ptr, o->via.raw.size);
                  ~~~~~~ ^
/usr/include/secure/_string.h:65:33: note: expanded from macro 'memcpy'
  __builtin___memcpy_chk (dest, src, len, __darwin_obsz0 (dest))
                                ^
util.c:22:35: error: no member named 'raw' in 'msgpack_object_union'
        memcpy(s, o->via.raw.ptr, o->via.raw.size);
                                  ~~~~~~ ^
/usr/include/secure/_string.h:65:38: note: expanded from macro 'memcpy'
  __builtin___memcpy_chk (dest, src, len, __darwin_obsz0 (dest))
                                     ^
util.c:23:11: error: no member named 'raw' in 'msgpack_object_union'
        s[o->via.raw.size] = 0;
          ~~~~~~ ^
util.c:31:7: error: use of undeclared identifier 'MSGPACK_OBJECT_RAW'; did you mean 'MSGPACK_OBJECT_MAP'?
        case MSGPACK_OBJECT_RAW:
             ^~~~~~~~~~~~~~~~~~
             MSGPACK_OBJECT_MAP
/usr/local/include/msgpack/object.h:38:5: note: 'MSGPACK_OBJECT_MAP' declared here
    MSGPACK_OBJECT_MAP                  = 0x07,
    ^
util.c:32:14: error: no member named 'raw' in 'msgpack_object_union'
                if (o->via.raw.size >= bufsize)    return NULL;
                    ~~~~~~ ^
util.c:33:20: error: no member named 'raw' in 'msgpack_object_union'
                memcpy(s, o->via.raw.ptr, o->via.raw.size);
                          ~~~~~~ ^
/usr/include/secure/_string.h:65:33: note: expanded from macro 'memcpy'
  __builtin___memcpy_chk (dest, src, len, __darwin_obsz0 (dest))
                                ^
util.c:33:36: error: no member named 'raw' in 'msgpack_object_union'
                memcpy(s, o->via.raw.ptr, o->via.raw.size);
                                          ~~~~~~ ^
/usr/include/secure/_string.h:65:38: note: expanded from macro 'memcpy'
  __builtin___memcpy_chk (dest, src, len, __darwin_obsz0 (dest))
                                     ^
util.c:34:12: error: no member named 'raw' in 'msgpack_object_union'
                s[o->via.raw.size] = 0;
                  ~~~~~~ ^
util.c:51:17: error: use of undeclared identifier 'MSGPACK_OBJECT_RAW'; did you mean 'MSGPACK_OBJECT_MAP'?
        if (o->type != MSGPACK_OBJECT_RAW) return 0;
                       ^~~~~~~~~~~~~~~~~~
                       MSGPACK_OBJECT_MAP
/usr/local/include/msgpack/object.h:38:5: note: 'MSGPACK_OBJECT_MAP' declared here
    MSGPACK_OBJECT_MAP                  = 0x07,
    ^
util.c:53:13: error: no member named 'raw' in 'msgpack_object_union'
        if (o->via.raw.size != l) return 0;
            ~~~~~~ ^
util.c:54:24: error: no member named 'raw' in 'msgpack_object_union'
        return strncmp(o->via.raw.ptr, s, l) == 0;
                       ~~~~~~ ^
14 errors generated.
make: *** [util.o] Error 1

fmgdias avatar Sep 15 '17 00:09 fmgdias

Hello,

On 15 Sep 2017, at 02:50, Fabrício Dias <[email protected] mailto:[email protected]> wrote:

cc -c -Wall -Wno-unused-function -Werror -O3 -g -I/usr/local/include -I/opt/local/include -o util.o util.c util.c:16:17: error: use of undeclared identifier 'MSGPACK_OBJECT_RAW'; did you mean 'MSGPACK_OBJECT_MAP'? if (o->type != MSGPACK_OBJECT_RAW) ^~~~~~~~~~~~~~~~~~ MSGPACK_OBJECT_MAP /usr/local/include/msgpack/object.h:38:5: note: 'MSGPACK_OBJECT_MAP' declared here MSGPACK_OBJECT_MAP = 0x07, ^

What version of msgpack are you trying to work with?

\Anton.

tobez avatar Sep 15 '17 05:09 tobez

msgpack 2.1.5

fmgdias avatar Sep 15 '17 10:09 fmgdias

I see. They must have changed their API (again). I will take steps to rectify this situation. Frankly, I am considering switching from message pack format to CBOR (RFC7049). In the meantime, please see whether you can use an older version of msgpack, such as http://msgpack.org/releases/cpp/msgpack-0.5.7.tar.gz http://msgpack.org/releases/cpp/msgpack-0.5.7.tar.gz , which is known to work well.

\Anton.

On 15 Sep 2017, at 12:23, Fabrício Dias <[email protected] mailto:[email protected]> wrote:

msgpack 2.1.5

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tobez/snmp-query-engine/issues/3#issuecomment-329743629, or mute the thread https://github.com/notifications/unsubscribe-auth/AAD4v-bZZt421gGdj3SxphY2g_2z7X4Oks5silAtgaJpZM4PYWy-.

https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png https://github.com/tobez/snmp-query-engine https://github.com/tobez/snmp-query-engine/issues/3#issuecomment-329743629

tobez avatar Sep 15 '17 10:09 tobez

Yes, I was able to compile with the previous version and it worked. but I agree with you CBOR would be fantastic. tks

fmgdias avatar Sep 15 '17 10:09 fmgdias

Apache Thrift is good too

fmgdias avatar Sep 15 '17 13:09 fmgdias