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. error: 'QCopChannel' was not declared in this scope

error: 'QCopChannel' was not declared in this scope

Scheduled Pinned Locked Moved Solved General and Desktop
20 Posts 6 Posters 6.4k 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.
  • K Offline
    K Offline
    Kashif
    wrote on last edited by VRonin
    #1

    Hi All,

    I am trying to understand the QCOP IPC level communication and what I understand so far is that QCOP is something similar to POSIX Message Queues.
    To test the power and feasibility I am developing a test application but getting subject error that I am unable to solve. Any body who can help me creating a test application, below is a sample code of my QT Core GUI application:

    #include <QCopChannel>
    
    
    void MainWindow::on_pushButton_clicked()
    {
    //    **QCopchannel qcopreceiver** = new QCopChannel(QCString("MYCHANNEL"), this, "myreceiver");
        **QCopChannel qcopreceiver** = new QCopChannel("MYCHANNEL",this);
        connect (qcopreceiver, SIGNAL(received(const QCString&,const QByteArray&)),this, SLOT(receivedSoemthing(const QCString&,const QByteArray&)) );
    }
    

    The error appears on both qcopreceiver initialization.

    Thanks

    1 Reply Last reply
    0
    • JohanSoloJ Offline
      JohanSoloJ Offline
      JohanSolo
      wrote on last edited by JohanSolo
      #2

      Do you have a Java / C# background? Because the line
      QCopchannel qcopreceiver = new QCopChannel(QCString("MYCHANNEL"), this, "myreceiver");
      tries to assign a pointer on a QCopChannel to a QCopChannel instance, i.e QCopChannel* assigned to QCopChannel.

      The line should read
      QCopchannel* qcopreceiver = new QCopChannel(QCString("MYCHANNEL"), this, "myreceiver");

      Moreover there is a small typo in your commented line QCopChannel instead of QCopchannel.

      `They did not know it was impossible, so they did it.'
      -- Mark Twain

      K 1 Reply Last reply
      0
      • JohanSoloJ JohanSolo

        Do you have a Java / C# background? Because the line
        QCopchannel qcopreceiver = new QCopChannel(QCString("MYCHANNEL"), this, "myreceiver");
        tries to assign a pointer on a QCopChannel to a QCopChannel instance, i.e QCopChannel* assigned to QCopChannel.

        The line should read
        QCopchannel* qcopreceiver = new QCopChannel(QCString("MYCHANNEL"), this, "myreceiver");

        Moreover there is a small typo in your commented line QCopChannel instead of QCopchannel.

        K Offline
        K Offline
        Kashif
        wrote on last edited by
        #3

        Hi @JohanSolo,

        This line was commented in my code, where as in second line I mistakenly removed * to make the text bold.
        I replaced the line with suggested one but still getting same error. I am using QT 4.8.2 on Debian Linux:

        QCopChannel* qcopreceiver = new QCopChannel(QCString("MYCHANNEL"), this, "myreceiver");
        

        &

        QCopchannel* qcopreceiver = new QCopchannel(QCString("MYCHANNEL"), this, "myreceiver");
        
        1 Reply Last reply
        0
        • M Offline
          M Offline
          medyakovvit
          wrote on last edited by
          #4

          @Kashif From Qt's docs:

          Note that this class is only available in Qt for Embedded Linux.
          
          K 1 Reply Last reply
          2
          • M medyakovvit

            @Kashif From Qt's docs:

            Note that this class is only available in Qt for Embedded Linux.
            
            K Offline
            K Offline
            Kashif
            wrote on last edited by
            #5

            Hi @medyakovvit,

            What should we send if parent class (This) is not available?

            Ps, I have used "This" keyword in many places during my device POC, like when initializing QTcpSocket/Connecting signals & slots on both Desktop and Embedded Linux (tested and working on device)

            Thanks

            jsulmJ 1 Reply Last reply
            0
            • K Kashif

              Hi @medyakovvit,

              What should we send if parent class (This) is not available?

              Ps, I have used "This" keyword in many places during my device POC, like when initializing QTcpSocket/Connecting signals & slots on both Desktop and Embedded Linux (tested and working on device)

              Thanks

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by jsulm
              #6

              @Kashif He means that QCopChannel is only available for embedded Linux.
              See here: http://doc.qt.io/qt-4.8/qcopchannel.html#details

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

              K 1 Reply Last reply
              0
              • jsulmJ jsulm

                @Kashif He means that QCopChannel is only available for embedded Linux.
                See here: http://doc.qt.io/qt-4.8/qcopchannel.html#details

                K Offline
                K Offline
                Kashif
                wrote on last edited by
                #7

                Hi @jsulm,

                Yes I have read that QCop is only available in embedded Linux and I am also building the project in embedded Linux configuration.

                1 Reply Last reply
                0
                • VRoninV Offline
                  VRoninV Offline
                  VRonin
                  wrote on last edited by
                  #8

                  What version of Qt are you using?

                  "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                  ~Napoleon Bonaparte

                  On a crusade to banish setIndexWidget() from the holy land of Qt

                  K 1 Reply Last reply
                  0
                  • VRoninV VRonin

                    What version of Qt are you using?

                    K Offline
                    K Offline
                    Kashif
                    wrote on last edited by
                    #9

                    Hi @VRonin,

                    I am using QT 4.8.2 on Debian Linux.

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      Hi,

                      Did you compile that version of Qt with the embedded flag ?

                      Are you locked to that version of Qt ? If you can't go with Qt 5 then at least update to 4.8.7.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      K 1 Reply Last reply
                      0
                      • SGaistS SGaist

                        Hi,

                        Did you compile that version of Qt with the embedded flag ?

                        Are you locked to that version of Qt ? If you can't go with Qt 5 then at least update to 4.8.7.

                        K Offline
                        K Offline
                        Kashif
                        wrote on last edited by
                        #11

                        Hi @SGaist,
                        In project configuration I have selected the project > target = Embedded Linux > Build release0_1510808498708_2017-11-16_080103.jpg

                        I can not upgrade the QT version as this is recommended by the hardware vendor.

                        jsulmJ 1 Reply Last reply
                        0
                        • K Kashif

                          Hi @SGaist,
                          In project configuration I have selected the project > target = Embedded Linux > Build release0_1510808498708_2017-11-16_080103.jpg

                          I can not upgrade the QT version as this is recommended by the hardware vendor.

                          jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          @Kashif The question was whether Qt itself was build with embedded flag set.

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

                          K 1 Reply Last reply
                          0
                          • jsulmJ jsulm

                            @Kashif The question was whether Qt itself was build with embedded flag set.

                            K Offline
                            K Offline
                            Kashif
                            wrote on last edited by
                            #13

                            Hi @jsulm,

                            I am new to QT environment, can you please tell me how do I check this?

                            jsulmJ 1 Reply Last reply
                            0
                            • K Kashif

                              Hi @jsulm,

                              I am new to QT environment, can you please tell me how do I check this?

                              jsulmJ Offline
                              jsulmJ Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              @Kashif How did you install Qt?

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

                              K 1 Reply Last reply
                              0
                              • jsulmJ jsulm

                                @Kashif How did you install Qt?

                                K Offline
                                K Offline
                                Kashif
                                wrote on last edited by
                                #15

                                Hi @jsulm,

                                I use synaptic package manager to simply install QT creator

                                jsulmJ 1 Reply Last reply
                                0
                                • K Kashif

                                  Hi @jsulm,

                                  I use synaptic package manager to simply install QT creator

                                  jsulmJ Offline
                                  jsulmJ Offline
                                  jsulm
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #16

                                  @Kashif Then I guess you simply installed Qt which comes with your Linux distribution and isn't build for embedded Linux.

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

                                  K 2 Replies Last reply
                                  1
                                  • SGaistS Offline
                                    SGaistS Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #17

                                    If recommended is 4.8.2 then 4.8.7 should work as well.

                                    If you want to build your application and test it on your desktop, you'll have to do an x86 embedded build.

                                    Interested in AI ? www.idiap.ch
                                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    1 Reply Last reply
                                    2
                                    • jsulmJ jsulm

                                      @Kashif Then I guess you simply installed Qt which comes with your Linux distribution and isn't build for embedded Linux.

                                      K Offline
                                      K Offline
                                      Kashif
                                      wrote on last edited by
                                      #18

                                      Hi @jsulm,
                                      As per my knowledge, QT itself (or QT Creator) is not an environment but just an IDE. To build application for embedded systems we have to use cross compiler to compile and link the code and that is what I am doing here.

                                      jsulmJ 1 Reply Last reply
                                      0
                                      • jsulmJ jsulm

                                        @Kashif Then I guess you simply installed Qt which comes with your Linux distribution and isn't build for embedded Linux.

                                        K Offline
                                        K Offline
                                        Kashif
                                        wrote on last edited by
                                        #19

                                        Hi @jsulm,

                                        I finally compiled the code successfully, it seems that correct compiler was not being called with make file.

                                        1 Reply Last reply
                                        0
                                        • K Kashif

                                          Hi @jsulm,
                                          As per my knowledge, QT itself (or QT Creator) is not an environment but just an IDE. To build application for embedded systems we have to use cross compiler to compile and link the code and that is what I am doing here.

                                          jsulmJ Offline
                                          jsulmJ Offline
                                          jsulm
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #20

                                          @Kashif QtCreator is an IDE, Qt is a C++ framework

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

                                          1 Reply Last reply
                                          1

                                          • Login

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