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. Qt sctp problem: Can not define a QSctpSocket/QSctpServer object

Qt sctp problem: Can not define a QSctpSocket/QSctpServer object

Scheduled Pinned Locked Moved Unsolved General and Desktop
sctp
10 Posts 2 Posters 772 Views
  • 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.
  • Y Offline
    Y Offline
    ytexas
    wrote on 1 Aug 2019, 03:59 last edited by ytexas 8 Jan 2019, 06:23
    #1

    Hi~
    As following topcis&question says :
    https://forum.qt.io/topic/76065/error-qsctpsocket-does-not-name-a-type-qsctpsocket-t-new-qsctpsocket-please-how-do-we-solve-this-error-or-is-it-qt-5-8-has-this-error

    I meet a similar problem. I can't define a QSctpSocket or QSctpServer object while I'm already added "QT += network" and each header in my project.
    Seems like sctp module not add in Qt. (enviroment: Qt5.12.4, Archlinux)

    As following links says: Cause Qt Sctp not support in Windows platform, so sctp is disabled in Qt.
    https://doc.qt.io/qt-5/qsctpsocket.html#details
    https://stackoverflow.com/questions/49503376/qt-stream-control-transmission-protocol-sctp
    https://stackoverflow.com/questions/56554944/how-to-enable-making-objects-from-qsctpsocket?r=SearchResults

    His solution is add "-stcp" and "-static" flag when configure/compilering Qt. (as folloing command)

    ./configure -sctp
    make 
    make install
    

    But, what about normal version Qt. (I mean installed from repository or Qt Installer. Not installed by compile? What should we do? )

    I'll really appreciate for your help. >.<

    J 1 Reply Last reply 1 Aug 2019, 04:21
    0
    • Y ytexas
      1 Aug 2019, 03:59

      Hi~
      As following topcis&question says :
      https://forum.qt.io/topic/76065/error-qsctpsocket-does-not-name-a-type-qsctpsocket-t-new-qsctpsocket-please-how-do-we-solve-this-error-or-is-it-qt-5-8-has-this-error

      I meet a similar problem. I can't define a QSctpSocket or QSctpServer object while I'm already added "QT += network" and each header in my project.
      Seems like sctp module not add in Qt. (enviroment: Qt5.12.4, Archlinux)

      As following links says: Cause Qt Sctp not support in Windows platform, so sctp is disabled in Qt.
      https://doc.qt.io/qt-5/qsctpsocket.html#details
      https://stackoverflow.com/questions/49503376/qt-stream-control-transmission-protocol-sctp
      https://stackoverflow.com/questions/56554944/how-to-enable-making-objects-from-qsctpsocket?r=SearchResults

      His solution is add "-stcp" and "-static" flag when configure/compilering Qt. (as folloing command)

      ./configure -sctp
      make 
      make install
      

      But, what about normal version Qt. (I mean installed from repository or Qt Installer. Not installed by compile? What should we do? )

      I'll really appreciate for your help. >.<

      J Online
      J Online
      jsulm
      Lifetime Qt Champion
      wrote on 1 Aug 2019, 04:21 last edited by jsulm 8 Jan 2019, 04:37
      #2

      @ytexas Well, if SCTP is not implemented in Qt on Windows (as stated here: https://bugreports.qt.io/browse/QTBUG-59282) the only thing you can do is to build Qt by yourself with activated SCTP support.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      Y 1 Reply Last reply 1 Aug 2019, 06:14
      3
      • J jsulm
        1 Aug 2019, 04:21

        @ytexas Well, if SCTP is not implemented in Qt on Windows (as stated here: https://bugreports.qt.io/browse/QTBUG-59282) the only thing you can do is to build Qt by yourself with activated SCTP support.

        Y Offline
        Y Offline
        ytexas
        wrote on 1 Aug 2019, 06:14 last edited by ytexas 8 Jan 2019, 06:22
        #3

        @jsulm
        Thank you :D

        But I'm try to use SCTP on Linux. (Archlinux or Ubuntu) >.<

        I find some official examples about SCTP (multistreamserver & multistreamclient) ( on path Qt/Examples/Qt-5.12.4/network) . But neither of them can be build in Qt Creator. I notice those two examples seems would not be load. Maybe caused by following code in Example's project file (network.pro):

        qtConfig(sctp): SUBDIRS += multistreamserver multistreamclient
        
        J 1 Reply Last reply 1 Aug 2019, 06:22
        0
        • Y ytexas
          1 Aug 2019, 06:14

          @jsulm
          Thank you :D

          But I'm try to use SCTP on Linux. (Archlinux or Ubuntu) >.<

          I find some official examples about SCTP (multistreamserver & multistreamclient) ( on path Qt/Examples/Qt-5.12.4/network) . But neither of them can be build in Qt Creator. I notice those two examples seems would not be load. Maybe caused by following code in Example's project file (network.pro):

          qtConfig(sctp): SUBDIRS += multistreamserver multistreamclient
          
          J Online
          J Online
          jsulm
          Lifetime Qt Champion
          wrote on 1 Aug 2019, 06:22 last edited by
          #4

          @ytexas said in Qt sctp problem: Can not define a QSctpSocket/QSctpServer object:

          But neither of them can be build in Qt Creator

          What happens? Errors?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          Y 1 Reply Last reply 1 Aug 2019, 06:26
          0
          • J jsulm
            1 Aug 2019, 06:22

            @ytexas said in Qt sctp problem: Can not define a QSctpSocket/QSctpServer object:

            But neither of them can be build in Qt Creator

            What happens? Errors?

            Y Offline
            Y Offline
            ytexas
            wrote on 1 Aug 2019, 06:26 last edited by ytexas 8 Jan 2019, 06:33
            #5

            @jsulm

            If load those examples directly ( multistreamserver.pro and multistreamclient.pro). Got compile error when building.

            However, load parent-pro file (network.pro). QtCreator would not load those two sub-project for build & running (edit only).

            J 1 Reply Last reply 1 Aug 2019, 07:04
            0
            • Y ytexas
              1 Aug 2019, 06:26

              @jsulm

              If load those examples directly ( multistreamserver.pro and multistreamclient.pro). Got compile error when building.

              However, load parent-pro file (network.pro). QtCreator would not load those two sub-project for build & running (edit only).

              J Online
              J Online
              jsulm
              Lifetime Qt Champion
              wrote on 1 Aug 2019, 07:04 last edited by
              #6

              @ytexas said in Qt sctp problem: Can not define a QSctpSocket/QSctpServer object:

              compile error

              You should post the errors...

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              Y 1 Reply Last reply 1 Aug 2019, 07:16
              2
              • J jsulm
                1 Aug 2019, 07:04

                @ytexas said in Qt sctp problem: Can not define a QSctpSocket/QSctpServer object:

                compile error

                You should post the errors...

                Y Offline
                Y Offline
                ytexas
                wrote on 1 Aug 2019, 07:16 last edited by ytexas 8 Jan 2019, 07:17
                #7

                @jsulm

                Sry. Cause error message is huge.

                For example. Build multistreamserver. Most of errors are invalid use of incomplete type 'class QSctpServer' and invalid use of incomplete type 'class QSctpSocket'

                So it seems Qt didn't have QSctpServer and QSctpcClient.

                Full error message is:

                ../chatprovider.cpp: In member function 'virtual void ChatProvider::readDatagram(QSctpSocket&, const QByteArray&)':
                ../chatprovider.cpp:64:28: error: invalid use of incomplete type 'class QSctpSocket'
                   64 |                       .arg(from.peerAddress().toString())
                      |                            ^~~~
                In file included from ../chatprovider.h:54,
                                 from ../chatprovider.cpp:51:
                ../provider.h:57:7: note: forward declaration of 'class QSctpSocket'
                   57 | class QSctpSocket;
                      |       ^~~~~~~~~~~
                ../chatprovider.cpp:65:44: error: invalid use of incomplete type 'class QSctpSocket'
                   65 |                       .arg(QString::number(from.peerPort()))
                      |                                            ^~~~
                In file included from ../chatprovider.h:54,
                                 from ../chatprovider.cpp:51:
                ../provider.h:57:7: note: forward declaration of 'class QSctpSocket'
                   57 | class QSctpSocket;
                      |       ^~~~~~~~~~~
                g++ -c -pipe -O2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../../multistreamserver -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtNetwork -isystem /usr/include/qt/QtCore -I. -isystem /usr/include/libdrm -I/usr/lib/qt/mkspecs/linux-g++ -o main.o ../main.cpp
                make: *** [Makefile:1026: chatprovider.o] Error 1
                make: *** Waiting for unfinished jobs....
                ../server.cpp: In constructor 'Server::Server(QWidget*)':
                ../server.cpp:68:38: error: invalid use of incomplete type 'class QSctpServer'
                   68 |     sctpServer = new QSctpServer(this);
                      |                                      ^
                In file included from ../server.cpp:55:
                ../server.h:59:7: note: forward declaration of 'class QSctpServer'
                   59 | class QSctpServer;
                      |       ^~~~~~~~~~~
                ../server.cpp:69:15: error: invalid use of incomplete type 'class QSctpServer'
                   69 |     sctpServer->setMaximumChannelCount(NumberOfChannels);
                      |               ^~
                In file included from ../server.cpp:55:
                ../server.h:59:7: note: forward declaration of 'class QSctpServer'
                   59 | class QSctpServer;
                      |       ^~~~~~~~~~~
                ../server.cpp:78:39: error: incomplete type 'QSctpServer' used in nested name specifier
                   78 |     connect(sctpServer, &QSctpServer::newConnection, this, &Server::newConnection);
                      |                                       ^~~~~~~~~~~~~
                ../server.cpp: In member function 'virtual int Server::exec()':
                ../server.cpp:97:20: error: invalid use of incomplete type 'class QSctpServer'
                   97 |     if (!sctpServer->listen()) {
                      |                    ^~
                In file included from ../server.cpp:55:
                ../server.h:59:7: note: forward declaration of 'class QSctpServer'
                   59 | class QSctpServer;
                      |       ^~~~~~~~~~~
                ../server.cpp:100:46: error: invalid use of incomplete type 'class QSctpServer'
                  100 |                               .arg(sctpServer->errorString()));
                      |                                              ^~
                In file included from ../server.cpp:55:
                ../server.h:59:7: note: forward declaration of 'class QSctpServer'
                   59 | class QSctpServer;
                      |       ^~~~~~~~~~~
                ../server.cpp:119:56: error: invalid use of incomplete type 'class QSctpServer'
                  119 |                          .arg(ipAddress).arg(sctpServer->serverPort()));
                      |                                                        ^~
                In file included from ../server.cpp:55:
                ../server.h:59:7: note: forward declaration of 'class QSctpServer'
                   59 | class QSctpServer;
                      |       ^~~~~~~~~~~
                ../server.cpp: In member function 'void Server::newConnection()':
                ../server.cpp:126:41: error: invalid use of incomplete type 'class QSctpServer'
                  126 |     QSctpSocket *connection = sctpServer->nextPendingDatagramConnection();
                      |                                         ^~
                In file included from ../server.cpp:55:
                ../server.h:59:7: note: forward declaration of 'class QSctpServer'
                   59 | class QSctpServer;
                      |       ^~~~~~~~~~~
                ../server.cpp:129:39: error: incomplete type 'QSctpSocket' used in nested name specifier
                  129 |     connect(connection, &QSctpSocket::channelReadyRead, this, &Server::readDatagram);
                      |                                       ^~~~~~~~~~~~~~~~
                ../server.cpp:130:39: error: incomplete type 'QSctpSocket' used in nested name specifier
                  130 |     connect(connection, &QSctpSocket::disconnected, this, &Server::clientDisconnected);
                      |                                       ^~~~~~~~~~~~
                ../server.cpp: In member function 'void Server::clientDisconnected()':
                ../server.cpp:138:66: error: invalid static_cast from type 'QObject*' to type 'QSctpSocket*'
                  138 |     QSctpSocket *connection = static_cast<QSctpSocket *>(sender());
                      |                                                                  ^
                In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                 from ../server.cpp:52:
                /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: class type 'QSctpSocket' is incomplete
                  107 |     friend class QSctpSocket;
                      |                  ^~~~~~~~~~~
                ../server.cpp:141:15: error: invalid use of incomplete type 'class QSctpSocket'
                  141 |     connection->disconnect();
                      |               ^~
                In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                 from ../server.cpp:52:
                /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: forward declaration of 'class QSctpSocket'
                  107 |     friend class QSctpSocket;
                      |                  ^~~~~~~~~~~
                ../server.cpp:146:15: error: invalid use of incomplete type 'class QSctpSocket'
                  146 |     connection->deleteLater();
                      |               ^~
                In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                 from ../server.cpp:52:
                /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: forward declaration of 'class QSctpSocket'
                  107 |     friend class QSctpSocket;
                      |                  ^~~~~~~~~~~
                ../server.cpp: In member function 'void Server::readDatagram(int)':
                ../server.cpp:151:66: error: invalid static_cast from type 'QObject*' to type 'QSctpSocket*'
                  151 |     QSctpSocket *connection = static_cast<QSctpSocket *>(sender());
                      |                                                                  ^
                In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                 from ../server.cpp:52:
                /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: class type 'QSctpSocket' is incomplete
                  107 |     friend class QSctpSocket;
                      |                  ^~~~~~~~~~~
                ../server.cpp:153:15: error: invalid use of incomplete type 'class QSctpSocket'
                  153 |     connection->setCurrentReadChannel(channel);
                      |               ^~
                In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                 from ../server.cpp:52:
                /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: forward declaration of 'class QSctpSocket'
                  107 |     friend class QSctpSocket;
                      |                  ^~~~~~~~~~~
                ../server.cpp:154:61: error: invalid use of incomplete type 'class QSctpSocket'
                  154 |     providers[channel]->readDatagram(*connection, connection->readDatagram().data());
                      |                                                             ^~
                In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                 from ../server.cpp:52:
                /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: forward declaration of 'class QSctpSocket'
                  107 |     friend class QSctpSocket;
                      |                  ^~~~~~~~~~~
                ../server.cpp: In member function 'void Server::writeDatagram(QSctpSocket*, const QByteArray&)':
                ../server.cpp:162:11: error: invalid use of incomplete type 'class QSctpSocket'
                  162 |         to->setCurrentWriteChannel(channel);
                      |           ^~
                In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                 from ../server.cpp:52:
                /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: forward declaration of 'class QSctpSocket'
                  107 |     friend class QSctpSocket;
                      |                  ^~~~~~~~~~~
                ../server.cpp:163:11: error: invalid use of incomplete type 'class QSctpSocket'
                  163 |         to->writeDatagram(ba);
                      |           ^~
                In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                 from ../server.cpp:52:
                /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: forward declaration of 'class QSctpSocket'
                  107 |     friend class QSctpSocket;
                      |                  ^~~~~~~~~~~
                ../server.cpp:168:19: error: invalid use of incomplete type 'class QSctpSocket'
                  168 |         connection->setCurrentWriteChannel(channel);
                      |                   ^~
                In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                 from ../server.cpp:52:
                /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: forward declaration of 'class QSctpSocket'
                  107 |     friend class QSctpSocket;
                      |                  ^~~~~~~~~~~
                ../server.cpp:169:19: error: invalid use of incomplete type 'class QSctpSocket'
                  169 |         connection->writeDatagram(ba);
                      |                   ^~
                In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                 from ../server.cpp:52:
                /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: forward declaration of 'class QSctpSocket'
                  107 |     friend class QSctpSocket;
                      |                  ^~~~~~~~~~~
                In file included from /usr/include/qt/QtCore/QtCore:4,
                                 from /usr/include/qt/QtWidgets/QtWidgetsDepends:3,
                                 from /usr/include/qt/QtWidgets/QtWidgets:3,
                                 from ../server.cpp:51:
                /usr/include/qt/QtCore/qmetatype.h: In instantiation of 'struct QtPrivate::IsPointerToTypeDerivedFromQObject<QSctpSocket*>':
                /usr/include/qt/QtCore/qmetatype.h:1643:60:   required from 'struct QMetaTypeId<QSctpSocket*>'
                /usr/include/qt/QtCore/qmetatype.h:1662:10:   required from 'struct QMetaTypeId2<QSctpSocket*>'
                /usr/include/qt/QtCore/qobject_impl.h:68:49:   required from 'struct QtPrivate::TypesAreDeclaredMetaType<QtPrivate::List<QSctpSocket*, const QByteArray&> >'
                /usr/include/qt/QtCore/qobject.h:251:86:   required from 'static QMetaObject::Connection QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const typename QtPrivate::FunctionPointer<Func2>::Object*, Func2, Qt::ConnectionType) [with Func1 = void (Provider::*)(QSctpSocket*, const QByteArray&); Func2 = void (Server::*)(QSctpSocket*, const QByteArray&); typename QtPrivate::FunctionPointer<Func>::Object = Provider; typename QtPrivate::FunctionPointer<Func2>::Object = Server]'
                ../server.cpp:80:99:   required from here
                /usr/include/qt/QtCore/qmetatype.h:1415:9: error: invalid application of 'sizeof' to incomplete type 'QSctpSocket'
                 1415 |         Q_STATIC_ASSERT_X(sizeof(T), "Type argument of Q_DECLARE_METATYPE(T*) must be fully defined");
                      |         ^~~~~~~~~~~~~~~~~
                make: *** [Makefile:1014: server.o] Error 1
                
                

                Thanks for attention so much >.<

                J 1 Reply Last reply 1 Aug 2019, 07:23
                0
                • Y ytexas
                  1 Aug 2019, 07:16

                  @jsulm

                  Sry. Cause error message is huge.

                  For example. Build multistreamserver. Most of errors are invalid use of incomplete type 'class QSctpServer' and invalid use of incomplete type 'class QSctpSocket'

                  So it seems Qt didn't have QSctpServer and QSctpcClient.

                  Full error message is:

                  ../chatprovider.cpp: In member function 'virtual void ChatProvider::readDatagram(QSctpSocket&, const QByteArray&)':
                  ../chatprovider.cpp:64:28: error: invalid use of incomplete type 'class QSctpSocket'
                     64 |                       .arg(from.peerAddress().toString())
                        |                            ^~~~
                  In file included from ../chatprovider.h:54,
                                   from ../chatprovider.cpp:51:
                  ../provider.h:57:7: note: forward declaration of 'class QSctpSocket'
                     57 | class QSctpSocket;
                        |       ^~~~~~~~~~~
                  ../chatprovider.cpp:65:44: error: invalid use of incomplete type 'class QSctpSocket'
                     65 |                       .arg(QString::number(from.peerPort()))
                        |                                            ^~~~
                  In file included from ../chatprovider.h:54,
                                   from ../chatprovider.cpp:51:
                  ../provider.h:57:7: note: forward declaration of 'class QSctpSocket'
                     57 | class QSctpSocket;
                        |       ^~~~~~~~~~~
                  g++ -c -pipe -O2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../../multistreamserver -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtNetwork -isystem /usr/include/qt/QtCore -I. -isystem /usr/include/libdrm -I/usr/lib/qt/mkspecs/linux-g++ -o main.o ../main.cpp
                  make: *** [Makefile:1026: chatprovider.o] Error 1
                  make: *** Waiting for unfinished jobs....
                  ../server.cpp: In constructor 'Server::Server(QWidget*)':
                  ../server.cpp:68:38: error: invalid use of incomplete type 'class QSctpServer'
                     68 |     sctpServer = new QSctpServer(this);
                        |                                      ^
                  In file included from ../server.cpp:55:
                  ../server.h:59:7: note: forward declaration of 'class QSctpServer'
                     59 | class QSctpServer;
                        |       ^~~~~~~~~~~
                  ../server.cpp:69:15: error: invalid use of incomplete type 'class QSctpServer'
                     69 |     sctpServer->setMaximumChannelCount(NumberOfChannels);
                        |               ^~
                  In file included from ../server.cpp:55:
                  ../server.h:59:7: note: forward declaration of 'class QSctpServer'
                     59 | class QSctpServer;
                        |       ^~~~~~~~~~~
                  ../server.cpp:78:39: error: incomplete type 'QSctpServer' used in nested name specifier
                     78 |     connect(sctpServer, &QSctpServer::newConnection, this, &Server::newConnection);
                        |                                       ^~~~~~~~~~~~~
                  ../server.cpp: In member function 'virtual int Server::exec()':
                  ../server.cpp:97:20: error: invalid use of incomplete type 'class QSctpServer'
                     97 |     if (!sctpServer->listen()) {
                        |                    ^~
                  In file included from ../server.cpp:55:
                  ../server.h:59:7: note: forward declaration of 'class QSctpServer'
                     59 | class QSctpServer;
                        |       ^~~~~~~~~~~
                  ../server.cpp:100:46: error: invalid use of incomplete type 'class QSctpServer'
                    100 |                               .arg(sctpServer->errorString()));
                        |                                              ^~
                  In file included from ../server.cpp:55:
                  ../server.h:59:7: note: forward declaration of 'class QSctpServer'
                     59 | class QSctpServer;
                        |       ^~~~~~~~~~~
                  ../server.cpp:119:56: error: invalid use of incomplete type 'class QSctpServer'
                    119 |                          .arg(ipAddress).arg(sctpServer->serverPort()));
                        |                                                        ^~
                  In file included from ../server.cpp:55:
                  ../server.h:59:7: note: forward declaration of 'class QSctpServer'
                     59 | class QSctpServer;
                        |       ^~~~~~~~~~~
                  ../server.cpp: In member function 'void Server::newConnection()':
                  ../server.cpp:126:41: error: invalid use of incomplete type 'class QSctpServer'
                    126 |     QSctpSocket *connection = sctpServer->nextPendingDatagramConnection();
                        |                                         ^~
                  In file included from ../server.cpp:55:
                  ../server.h:59:7: note: forward declaration of 'class QSctpServer'
                     59 | class QSctpServer;
                        |       ^~~~~~~~~~~
                  ../server.cpp:129:39: error: incomplete type 'QSctpSocket' used in nested name specifier
                    129 |     connect(connection, &QSctpSocket::channelReadyRead, this, &Server::readDatagram);
                        |                                       ^~~~~~~~~~~~~~~~
                  ../server.cpp:130:39: error: incomplete type 'QSctpSocket' used in nested name specifier
                    130 |     connect(connection, &QSctpSocket::disconnected, this, &Server::clientDisconnected);
                        |                                       ^~~~~~~~~~~~
                  ../server.cpp: In member function 'void Server::clientDisconnected()':
                  ../server.cpp:138:66: error: invalid static_cast from type 'QObject*' to type 'QSctpSocket*'
                    138 |     QSctpSocket *connection = static_cast<QSctpSocket *>(sender());
                        |                                                                  ^
                  In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                   from ../server.cpp:52:
                  /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: class type 'QSctpSocket' is incomplete
                    107 |     friend class QSctpSocket;
                        |                  ^~~~~~~~~~~
                  ../server.cpp:141:15: error: invalid use of incomplete type 'class QSctpSocket'
                    141 |     connection->disconnect();
                        |               ^~
                  In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                   from ../server.cpp:52:
                  /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: forward declaration of 'class QSctpSocket'
                    107 |     friend class QSctpSocket;
                        |                  ^~~~~~~~~~~
                  ../server.cpp:146:15: error: invalid use of incomplete type 'class QSctpSocket'
                    146 |     connection->deleteLater();
                        |               ^~
                  In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                   from ../server.cpp:52:
                  /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: forward declaration of 'class QSctpSocket'
                    107 |     friend class QSctpSocket;
                        |                  ^~~~~~~~~~~
                  ../server.cpp: In member function 'void Server::readDatagram(int)':
                  ../server.cpp:151:66: error: invalid static_cast from type 'QObject*' to type 'QSctpSocket*'
                    151 |     QSctpSocket *connection = static_cast<QSctpSocket *>(sender());
                        |                                                                  ^
                  In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                   from ../server.cpp:52:
                  /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: class type 'QSctpSocket' is incomplete
                    107 |     friend class QSctpSocket;
                        |                  ^~~~~~~~~~~
                  ../server.cpp:153:15: error: invalid use of incomplete type 'class QSctpSocket'
                    153 |     connection->setCurrentReadChannel(channel);
                        |               ^~
                  In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                   from ../server.cpp:52:
                  /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: forward declaration of 'class QSctpSocket'
                    107 |     friend class QSctpSocket;
                        |                  ^~~~~~~~~~~
                  ../server.cpp:154:61: error: invalid use of incomplete type 'class QSctpSocket'
                    154 |     providers[channel]->readDatagram(*connection, connection->readDatagram().data());
                        |                                                             ^~
                  In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                   from ../server.cpp:52:
                  /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: forward declaration of 'class QSctpSocket'
                    107 |     friend class QSctpSocket;
                        |                  ^~~~~~~~~~~
                  ../server.cpp: In member function 'void Server::writeDatagram(QSctpSocket*, const QByteArray&)':
                  ../server.cpp:162:11: error: invalid use of incomplete type 'class QSctpSocket'
                    162 |         to->setCurrentWriteChannel(channel);
                        |           ^~
                  In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                   from ../server.cpp:52:
                  /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: forward declaration of 'class QSctpSocket'
                    107 |     friend class QSctpSocket;
                        |                  ^~~~~~~~~~~
                  ../server.cpp:163:11: error: invalid use of incomplete type 'class QSctpSocket'
                    163 |         to->writeDatagram(ba);
                        |           ^~
                  In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                   from ../server.cpp:52:
                  /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: forward declaration of 'class QSctpSocket'
                    107 |     friend class QSctpSocket;
                        |                  ^~~~~~~~~~~
                  ../server.cpp:168:19: error: invalid use of incomplete type 'class QSctpSocket'
                    168 |         connection->setCurrentWriteChannel(channel);
                        |                   ^~
                  In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                   from ../server.cpp:52:
                  /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: forward declaration of 'class QSctpSocket'
                    107 |     friend class QSctpSocket;
                        |                  ^~~~~~~~~~~
                  ../server.cpp:169:19: error: invalid use of incomplete type 'class QSctpSocket'
                    169 |         connection->writeDatagram(ba);
                        |                   ^~
                  In file included from /usr/include/qt/QtNetwork/QtNetwork:31,
                                   from ../server.cpp:52:
                  /usr/include/qt/QtNetwork/qnetworkdatagram.h:107:18: note: forward declaration of 'class QSctpSocket'
                    107 |     friend class QSctpSocket;
                        |                  ^~~~~~~~~~~
                  In file included from /usr/include/qt/QtCore/QtCore:4,
                                   from /usr/include/qt/QtWidgets/QtWidgetsDepends:3,
                                   from /usr/include/qt/QtWidgets/QtWidgets:3,
                                   from ../server.cpp:51:
                  /usr/include/qt/QtCore/qmetatype.h: In instantiation of 'struct QtPrivate::IsPointerToTypeDerivedFromQObject<QSctpSocket*>':
                  /usr/include/qt/QtCore/qmetatype.h:1643:60:   required from 'struct QMetaTypeId<QSctpSocket*>'
                  /usr/include/qt/QtCore/qmetatype.h:1662:10:   required from 'struct QMetaTypeId2<QSctpSocket*>'
                  /usr/include/qt/QtCore/qobject_impl.h:68:49:   required from 'struct QtPrivate::TypesAreDeclaredMetaType<QtPrivate::List<QSctpSocket*, const QByteArray&> >'
                  /usr/include/qt/QtCore/qobject.h:251:86:   required from 'static QMetaObject::Connection QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const typename QtPrivate::FunctionPointer<Func2>::Object*, Func2, Qt::ConnectionType) [with Func1 = void (Provider::*)(QSctpSocket*, const QByteArray&); Func2 = void (Server::*)(QSctpSocket*, const QByteArray&); typename QtPrivate::FunctionPointer<Func>::Object = Provider; typename QtPrivate::FunctionPointer<Func2>::Object = Server]'
                  ../server.cpp:80:99:   required from here
                  /usr/include/qt/QtCore/qmetatype.h:1415:9: error: invalid application of 'sizeof' to incomplete type 'QSctpSocket'
                   1415 |         Q_STATIC_ASSERT_X(sizeof(T), "Type argument of Q_DECLARE_METATYPE(T*) must be fully defined");
                        |         ^~~~~~~~~~~~~~~~~
                  make: *** [Makefile:1014: server.o] Error 1
                  
                  

                  Thanks for attention so much >.<

                  J Online
                  J Online
                  jsulm
                  Lifetime Qt Champion
                  wrote on 1 Aug 2019, 07:23 last edited by
                  #8

                  @ytexas Same for me. Probably Qt was build without support for SCTP.
                  I see this in qsctpsocket.h:

                  #if !defined(QT_NO_SCTP) || defined(Q_CLANG_QDOC)
                  

                  My guess is you need to build Qt by yourself and activate SCTP support.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  Y 1 Reply Last reply 1 Aug 2019, 07:36
                  2
                  • J jsulm
                    1 Aug 2019, 07:23

                    @ytexas Same for me. Probably Qt was build without support for SCTP.
                    I see this in qsctpsocket.h:

                    #if !defined(QT_NO_SCTP) || defined(Q_CLANG_QDOC)
                    

                    My guess is you need to build Qt by yourself and activate SCTP support.

                    Y Offline
                    Y Offline
                    ytexas
                    wrote on 1 Aug 2019, 07:36 last edited by
                    #9

                    @jsulm
                    Thank you so much. xD
                    So, current situation is: official releases 's SCTP is unavailable. Build Qt from source is only solution. TuT

                    J 1 Reply Last reply 1 Aug 2019, 07:39
                    0
                    • Y ytexas
                      1 Aug 2019, 07:36

                      @jsulm
                      Thank you so much. xD
                      So, current situation is: official releases 's SCTP is unavailable. Build Qt from source is only solution. TuT

                      J Online
                      J Online
                      jsulm
                      Lifetime Qt Champion
                      wrote on 1 Aug 2019, 07:39 last edited by jsulm 8 Jan 2019, 07:50
                      #10

                      @ytexas Looks like this, yes. I don't know why SCTP is not built in official releases, maybe it's considered not stable enough.

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0

                      2/10

                      1 Aug 2019, 04:21

                      8 unread
                      • Login

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