Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] size_t does not name a type
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] size_t does not name a type

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 34.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TimChev
    wrote on 4 Dec 2014, 09:58 last edited by
    #1

    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.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on 4 Dec 2014, 11:39 last edited by
      #2

      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.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • T Offline
        T Offline
        TimChev
        wrote on 4 Dec 2014, 12:39 last edited by
        #3

        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.

        1 Reply Last reply
        0
        • C Online
          C Online
          Chris Kawa
          Lifetime Qt Champion
          wrote on 4 Dec 2014, 13:00 last edited by
          #4

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

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

          1 Reply Last reply
          0
          • T Offline
            T Offline
            TimChev
            wrote on 4 Dec 2014, 13:26 last edited by
            #5

            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;
            _@

            1 Reply Last reply
            0
            • T Offline
              T Offline
              TimChev
              wrote on 16 Dec 2014, 12:45 last edited by
              #6

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

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved