error: 'QCopChannel' was not declared in this scope
-
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
-
Do you have a Java / C# background? Because the line
QCopchannel qcopreceiver = new QCopChannel(QCString("MYCHANNEL"), this, "myreceiver");
tries to assign a pointer on aQCopChannelto aQCopChannelinstance, i.eQCopChannel*assigned toQCopChannel.The line should read
QCopchannel* qcopreceiver = new QCopChannel(QCString("MYCHANNEL"), this, "myreceiver");Moreover there is a small typo in your commented line
QCopChannelinstead ofQCopchannel. -
Do you have a Java / C# background? Because the line
QCopchannel qcopreceiver = new QCopChannel(QCString("MYCHANNEL"), this, "myreceiver");
tries to assign a pointer on aQCopChannelto aQCopChannelinstance, i.eQCopChannel*assigned toQCopChannel.The line should read
QCopchannel* qcopreceiver = new QCopChannel(QCString("MYCHANNEL"), this, "myreceiver");Moreover there is a small typo in your commented line
QCopChannelinstead ofQCopchannel.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"); -
@Kashif From Qt's docs:
Note that this class is only available in Qt for Embedded Linux. -
@Kashif From Qt's docs:
Note that this class is only available in Qt for Embedded Linux.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
-
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
@Kashif He means that QCopChannel is only available for embedded Linux.
See here: http://doc.qt.io/qt-4.8/qcopchannel.html#details -
@Kashif He means that QCopChannel is only available for embedded Linux.
See here: http://doc.qt.io/qt-4.8/qcopchannel.html#details -
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.
-
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.
-
Hi @SGaist,
In project configuration I have selected the project > target = Embedded Linux > Build release
I can not upgrade the QT version as this is recommended by the hardware vendor.
-
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.
-
@Kashif Then I guess you simply installed Qt which comes with your Linux distribution and isn't build for embedded Linux.
-
@Kashif Then I guess you simply installed Qt which comes with your Linux distribution and isn't build for embedded Linux.
-
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.