[SOLVED] size_t does not name a type



  • Hi,

    I'm working on Ubuntu 14.04, with Qt5.3.1 on Qt Creator 3.1.2.

    I'm dealing on a simple poject with 1 class and a main.

    I'm having trouble at compiling, I have errors like "size_t does not name a type", "int32_t" has not been declared" or "__gnuc_va_list has not been declared".

    Here is my .pro :
    @
    QT += core widgets network
    CONFIG += c++11
    DEFINES += NOMINMAX
    HEADERS +=
    IvyBus.h
    SOURCES +=
    main.cpp
    IvyBus.cpp

    unix:!macx: LIBS += -lIvy

    INCLUDEPATH += /usr/include
    DEPENDPATH += /usr/include
    @
    Ivy is a communication bus that allows transmition of text messages between applications.
    I already searched solutions, and tried to include libs such as stdlib, stdarg in my project but no way to progress.

    Does anyone already have this issue ? Any idea ?

    Thanks a lot.


  • Moderators

    I ran into a similar problem.
    Here is a "reference":https://gcc.gnu.org/gcc-4.6/porting_to.html to what you have to do.



  • It didn't work. I have the exactly same errors. My ggc's version is 4.8.2, not 4.6.

    I tried compiling in commandline with g++ and with Qt Creator, same results.


  • Moderators

    "It didn't work" is not very descriptive.

    Are you sure you're including <cstddef> and <cstdint> before ivybus headers?



  • Yes I included them before ivybus headers in the main.cpp.
    To be more specific, I still have the same errors involving problems with size_t, int32_t, __off64_t, __ssize_t, __io_read_fn etc.

    A detail of some of the errors, if it can help :

    @_In file included from /usr/include/stdio.h:74:0,
    from /usr/include/c++/4.8/cstdio:42,
    from /usr/include/c++/4.8/random:39,
    from /usr/include/c++/4.8/bits/stl_algo.h:65,
    from /usr/include/c++/4.8/algorithm:62,
    from /usr/include/qt5/QtCore/qglobal.h:82,
    from /usr/include/qt5/QtCore/qpair.h:45,
    from /usr/include/qt5/QtNetwork/qhostaddress.h:45,
    from /usr/include/qt5/QtNetwork/QHostAddress:1,
    from ../ivy_test/IvyBus.h:7,
    from ../ivy_test/IvyBus.cpp:1:
    /usr/include/libio.h:274:3: error: '__off_t' does not name a type
    _IO_off_t _old_offset; /* This used to be _offset but it's too small. */
    ^

    /usr/include/libio.h:293:3: error: '__off64_t' does not name a type
    _IO_off64_t _offset;
    ^

    /usr/include/libio.h:306:3: error: 'size_t' does not name a type
    size_t __pad5;
    ^
    /usr/include/libio.h:310:67: error: 'size_t' was not declared in this scope
    char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
    ^
    /usr/include/libio.h:310:67: note: suggested alternatives:
    In file included from /usr/include/c++/4.8/utility:68:0,
    from /usr/include/c++/4.8/algorithm:60,
    from /usr/include/qt5/QtCore/qglobal.h:82,
    from /usr/include/qt5/QtCore/qpair.h:45,
    from /usr/include/qt5/QtNetwork/qhostaddress.h:45,
    from /usr/include/qt5/QtNetwork/QHostAddress:1,
    from ../ivy_test/IvyBus.h:7,
    from ../ivy_test/IvyBus.cpp:1:
    /usr/include/x86_64-linux-gnu/c++/4.8/bits/c++config.h:186:26: note: 'std::size_t'
    typedef SIZE_TYPE size_t;
    ^

    _In file included from /usr/include/x86_64-linux-gnu/sys/types.h:146:0,
    from /usr/include/x86_64-linux-gnu/sys/uio.h:23,
    from /usr/include/x86_64-linux-gnu/sys/socket.h:26,
    from /usr/include/netinet/in.h:23,
    from /usr/local/include/Ivy/ivysocket.h:42,
    from /usr/include/Ivy/Ivycpp.h:25,
    from ../ivy_test/IvyBus.h:4,
    from ../ivy_test/IvyBus.cpp:1:
    /usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h:212:23: note: 'IvyC::size_t'
    typedef SIZE_TYPE size_t;
    _@



  • So, I solved my problem bi including stdio.h and sys/types.h. (So much time wasted for nothing !)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.