How to enable making objects from QSctpSocket? - c++

I am attempting to use QSctpServer & QSctpSocket, but I can't make an object from none of these classes.
What is the problem?
OS: Ubuntu 16.04
Qt version: 5.12.3
I also visited Qt stream control transmission protocol (sctp) but confused about what exactly should I do!
.pro is as follows:
QT += core
QT += network
TARGET = TcpServer
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app

Compile Qt by enabling -sctp flag solved the problem. After goring to Qt source folder did the following:
./configure -sctp
make
make install

Related

Openvino: Problem when trying to load CPU plugin in Qt

After installing and successfully run the OpenVino demos in my PC I start implementing a basic application in Qt with this library. I made the linking as Intel's documentation describes and the application successfully compiled.
auto plugin = PluginDispatcher({L""}).getPluginByDevice("CPU");
auto netBuilder = new CNNNetReader();
netBuilder->ReadNetwork("../TestModel/squeezenet1.1.xml");
netBuilder->ReadWeights("../TestModel/squeezenet1.1.bin");
auto network = netBuilder->getNetwork();
netBuilder->getNetwork().setBatchSize(1);
The application pops an exception when debugger reach getPluginByDevice call (getSuitablePlugin method from ie_plugin_dispacher.hpp (line 73)).
I am using MSVC2017 64bit with Qt 5.11.1 in a Windows 10 machine. The .pro file library call is:
#OpenVino
INCLUDEPATH += $$PWD/inference_engine/include
LIBS += -L$$PWD/inference_engine/lib/intel64/Release
LIBS += -linference_engine -llibiomp5md
Is anyone experienced the same or has an idea what's going on?
Thanks in advance,
Thanasis
The release libraries were causing the problem. When I switched to the debug ones (inference_engined.lib insted of inference_engine.lib) the application run successfully.
EDIT
I paste the code from .pro file in case someone face the same problem.
#OpenVino
INCLUDEPATH += $$PWD/inference_engine/include
CONFIG(release, debug|release):BuildVar=release
CONFIG(debug, debug|release):BuildVar=debug
equals(BuildVar,debug) {
message(Debug Mode)
LIBS += -L$$PWD/inference_engine/lib/intel64/Debug
LIBS += -linference_engined
}
equals(BuildVar,release) {
message(Release Mode)
LIBS += -L$$PWD/inference_engine/lib/intel64/Release
LIBS += -linference_engine
}

Invalid parameter passed to C runtime function, using a third party library (Using Qt)

I'm trying to develop an application using Qt and library to connect to a software server that controls an external USB device.
I created a new empty project and added a button and a textview.
I've also added these lines to the .pro file
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/iview/lib/ -liViewXAPI
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/iview/lib/ -liViewXAPId
INCLUDEPATH += $$PWD/iview/include
DEPENDPATH += $$PWD/iview/include
The paths mentioned above have both the .dlls and the .lib files. The machine in which I'm programming was delivered with the device to the Im sure that it is meant to work under Windows 7 x32. I've only written the following three lines of code:
ui->pteLog->appendPlainText("Establishing connection to server ....");
int result = iV_ConnectLocal();
ui->pteLog->appendPlainText("Result for connection was: " + QString::number(result));
When I try to run my application, I get the following output in the Application Output Window:
Attempting to open InpOut driver...
Successfully opened inpout32 driver
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Error - RtlWerpReportException failed with status code :-1073741823. Will try to launch the process directly
Closing InpOut driver...
The program crashes.
Is there any chance that this is happening simply because I've misconfigured Qt for use with the external library?
I'm using Qt 5.8.0 With MinGW 5.3.0 if that is of any use.
As requested, more information is given on the program and API:
The Function iV_Connnecthttps://www.smivision.com/). That server controls a device from the company connected to the PC through a USB Port. So to control de device you need to establish a connection to the server using a provided API. All of this works as the Laptop comes with the device and all the software installed (proprietary software provided by the company) which obviously connects to the device and works just fine. However, They also provide an API (called iViewXApi) so that you can make your custom software. This is what I want to do. So I did a Qt Program and the first step is to simply connect to the server. The line iV_ConnectLocal does exactly that.

When compiling get error: 'QtGui/QAction' file not found #include <QtGui/QAction>

I just installed Mac OS X 10.8.3 and Qt Creator 3, XCode, and XCode command line tools. I'm trying to compile a project that works on another computer but each time I go to "build all" I get error: 'QtGui/QAction' file not found
in #include <QtGui/QAction>
I tried adding the second and third line in the .pro file but it didn't help
QT += core gui opengl
CONFIG += qt
QT += gui
TARGET = BasicOpenGL
TEMPLATE = app
UPDATE: I also tried this .pro file and it didn't work
QT += core gui opengl
QT += widgets
TARGET = BasicOpenGL
TEMPLATE = app
I should say this is my first time attempting development on mac.
Compile Output from Qt
Versions/A/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/AGL.framework/Headers -I. -I. -F/Users/john/Qt/5.2.0/clang_64/lib -o mainwindow.o ../Framework/mainwindow.cpp
In file included from ../Framework/mainwindow.cpp:2:
../Framework/ui_mainwindow.h:14:10: fatal error: 'QtGui/QAction' file not found
#include <QtGui/QAction>
^
1 error generated.
make: *** [mainwindow.o] Error 1
15:51:32: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project BasicOpenGL (kit: Desktop Qt 5.2.0 clang 64bit)
When executing step 'Make'
UPDATE: I got it to work but with all the screwing around I'm not exactly sure what did it. I started with a fresh mac image, installed system updates, installed xcode, installed xcode command line tools, installed QT Creator 3.0, installed QT libraries 4.8.1, setup the compilers in QT Creator.
Try doing a make clean followed by a make. I had this exact problem on a Windows 7 system, and this is what worked for me.
In Qt5, QAction header is in QtWidgets include sub-directory, not in QtGui (that's true for Qt4). Though you don't actually need to specify include sub-directories since qmake will handle that for you. You just need to add QT += widgets to your .pro file.
Set the version to Qt5, change all #include<QtQui/*>s into #include<QtWidgets/*>.
And add QT += widgets in your .pro file.
Rebuild the project, when you get the error again, tap into the error message, and change the #include<QtQui/*>s into #include<QtWidgets/*> too.
Some answers here say that you have to change include from <QtGui/QAction> to <QtWidgets/QAction>.
It was the case when you compile under QT-5. But after QT-6 was released you have to do the opposite in QT-6 application.
Now you have to change <QtWidgets/QAction> to <QtGui/QAction>, because now QAction is located in QtGui folder in QT-6.
Although my answer is not related to your very old question, as you had QT-4 problem, still your question pops up first in Google hence I'm posting my answer for those StackOverflow visitors who have same problem but with compiling QT-5 project under QT-6, as I did.

How to configure a fresh installation of qtcreator?

I'm trying to configue QtCreator with no success. I want to open an existing project. When I try to compile and run it, I get only empty black console. It looks like it compiles fine but no output.
I've installed this 32bit version:
Qt 5.2.0 for Windows 32-bit (MinGW 4.8, OpenGL, 689 MB) (Info)
When I start a new project, QtCreator wants me to run cmake. When It's done, it works fine. I can also build HelloWorld with "g++ main.cpp"
Can anyone tell me what should I do step by step? I ran out of strength. I don't know why it doesn't work.
I think it is not very important, but I'm using Win7 64bit. First, I tried to install 64bit QtCreator:
Qt 5.2.0 for Windows 64-bit (VS 2012, OpenGL, 589 MB) (Info)
But I had some problems with compilers. It looked like I didn't have them installed. I also tried an online installer and now this 32bit version. Always same result.
EDIT:
I found out something. This works:
ComputerGraphics.pro
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
INCLUDEPATH += C:/Users/user/Desktop/projekty/PocitacovaGrafika2/opencv/include
LIBS += -LC:\\Users\user\\Desktop\\projekty\\PocitacovaGrafika2\\opencv\\bin \
libopencv_core246d \
libopencv_highgui246d \
libopencv_imgproc246d \
SOURCES += main.cpp \
and main.cpp
#include <iostream>
int main(){
std::cout << "Hello";
return 0;
}
This even doesn't print Hello (.pro is the same as previously):
#include <iostream>
int main(){
std::cout << "Hello";
IplImage* img = cvLoad("Desert.jpg",1);
cvShowImage("img",img);
cvWaitKey(0);
return 0;
}
In debug, it complains:
The gdb process terminated unexpectedly (code 0)
During startup program exited with code 0xc0000135.
My solution:
1)
I've gone through my own tutorial on how to compile opencv for qt-creator with cmake here:
How to link opencv in QtCreator and use Qt library
(but using the latest opencv 2.4.8)
2)
I created a folder opencv on desktop.
I went into newly created opencv_bin/install and copied a folder include into the opencv on the desktop.
I continued into directory: install/x64/mingw and copied both bin and lib into opencv on the desktop.
3)
I moved the desktop/opencv directory into a working directory of my project.
i.e cut: desktop/opencv; paste: somepath/myQtProject/
4)
My .pro contains a reference like this:
INCLUDEPATH += C:/Users/user/Desktop/projekty/PocitacovaGrafika2/opencv/include
LIBS += -LC:\\Users\\user\\Desktop\\projekty\\PocitacovaGrafika2\\opencv\\bin \
libopencv_core248d \
libopencv_highgui248d \
libopencv_imgproc248d \
And in the main.cpp just #include "opencv2/opencv.hpp"
PS: I hope this will also help somebody else.

"Can't load OpenGL extension [glBindBuffer] in function IntGetProcAddress" exception of OpenCV in Qt

I downloaded OpenCV 2.4.6 from the opencv website. To avoid the problem I mentioned before, I decided to compile the OpenCV library. After CMake and Mingw32-make, the compile succeeded. However, a simple test program crashes when tring to show a jpeg image. Here is my .pro and main.cpp file:
.pro:
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += main.cpp
#INCLUDEPATH += D:/opencv2.4.6/build/include
INCLUDEPATH += D:/opencv2.4.6/release/install/include
LIBS += -LD:/opencv2.4.6/release/install/bin \
-lopencv_core246 \
-lopencv_highgui246 \
-lopencv_imgproc246 \
-lopencv_features2d246 \
-lopencv_calib3d246
main.cpp:
int main() {
Mat input = imread("Z:/1.jpg");
cv::imshow("1.jpg",input);
}
Here is the problem:
OpenCV Error: OpenGL API call (Can't load OpenGL extension [glBindBuffer]) in In
tGetProcAddress, file ..\..\..\modules\core\src\gl_core_3_1.cpp, line 141
terminate called after throwing an instance of 'cv::Exception'
what(): ..\..\..\modules\core\src\gl_core_3_1.cpp:141: error: (-219) Can't lo
ad OpenGL extension [glBindBuffer] in function IntGetProcAddress
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
I've never encountered such problem before. It's kind of weird. What should I do to get rid of this problem?
After trying to compile OpenCV, it seems that the WITH_OPENGL should be unchecked. Now the program runs normally.