OpenSplice with Qt5 Execution Error Creation failed: invalid handle - c++

I'm trying to run the tutorial example of OpenSplice using Qt5. I successfully built the program but when I run it I get the following error :
Error in DDS::DomainParticipantFactory::create_participant: Creation
failed: invalid handle
After many debugging steps I came to the conclusion that my executable doesn't link to my ospl ! I figured that out because when it crashes no ospl-error.log is generated.
I sourced the release file correctly . ./release.com and launched my qtcreator from the same terminal so all the environment variables are correctly set (especially OSPL_URI and OSPL_HOME)
Does anyone have any idea on how to fix this ?

I finally managed to solve this problem and thought of sharing the answer.
The problem was that I was including all the DDS libs in my .pro I was including the following libs :
unix:!macx: LIBS += -L$$PWD/../../PrismTech/Vortex_v2/Device/VortexOpenSplice/6.7.1/HDE/x86_64.linux/lib/ -lcmagent -lcmjni -lcmsoap -lcmxml -ldbmsconnect -ldcpsc99 -ldcpsccpp -ldcpsgapi -ldcpsisocpp -ldcpsisocpp2 -ldcpssac -ldcpssacpp -ldcpssaj -lddsconf -lddsconfparser -lddsdatabase -lddshts -lddsi2 -lddsi2e -lddskernel -lddsos -lddsosnet -lddsrmi -lddsrrstorage -lddsserialization -lddsuser -lddsutil -ldurability -lfacecpp -lleveldb-ospl -llzf-ospl -lnetworking -lnwbridge -lrlm913 -lrnr -lsigar-amd64-linux -lsnappy-ospl -lsnetworking -lspliced -lsqlite3-ospl -lstreamsccpp -lstreamsisocpp -lstreamssacpp
INCLUDEPATH += $$PWD/../../PrismTech/Vortex_v2/Device/VortexOpenSplice/6.7.1/HDE/x86_64.linux/include
DEPENDPATH += $$PWD/../../PrismTech/Vortex_v2/Device/VortexOpenSplice/6.7.1/HDE/x86_64.linux/include
I am now using a minimal set of libs that the program requires and now it runs perfectly. Here is what I am using now:
unix:!macx: LIBS += -L$$PWD/../PrismTech/Vortex_v2/Device/VortexOpenSplice/6.7.1/HDE/x86_64.linux/lib/ -lddskernel -ldcpsisocpp
INCLUDEPATH += $$PWD/../PrismTech/Vortex_v2/Device/VortexOpenSplice/6.7.1/HDE/x86_64.linux/include
DEPENDPATH += $$PWD/../PrismTech/Vortex_v2/Device/VortexOpenSplice/6.7.1/HDE/x86_64.linux/include
Actually the error is caused by -ldcpsccpp and -lddshts. By removing those libs the application works perfectly.

Related

How to solve "Cannot read /qtsqldrivers-config.pri:" while building sql drivers for Qt5 for mac users

this is my mysql.pro file
TARGET = qsqlmysql
HEADERS += $$PWD/qsql_mysql_p.h
SOURCES += $$PWD/qsql_mysql.cpp $$PWD/main.cpp
QMAKE_USE += mysql
OTHER_FILES += mysql.json
PLUGIN_CLASS_NAME = QMYSQLDriverPlugin
include(../qsqldriverbase.pri)
INCLUDEPATH += "/usr/local/Cellar/mysql-client/8.0.21/include"
QMAKE_LIBDIR += "/usr/local/Cellar/mysql-client/8.0.21/lib"
The Error
Cannot read /qtsqldrivers-config.pri: No such file or directory
/Users/Lauben/Qt/5.15.0/clang_64/mkspecs/features/qt_plugin.prf:59: Cannot write file /mkspecs/modules-inst/qt_plugin_qsqlmysql.pri: Cannot create parent directory
13:01:35: The process "/Users/Lauben/Qt/5.15.0/clang_64/bin/qmake" exited with code 3.
Error while building/deploying project mysql (kit: Desktop Qt 5.15.0 clang 64bit)
When executing step "qmake"
clang_64 file
Clang screenshot

How to fix qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed error in QT

I am trying to learn how to network using Qt, and I recently got stuck with one of their examples, "The twitter timeline example", it keeps on giving me this error,"", after surfing the net, I found out that it is probably because I do not have openssl installed. Can someone please tell me what I am doing
After following this example and several others, How to Include OpenSSL in a Qt project , the problem remains unchanged.
this is my .pro file
QT = core widgets network networkauth
requires(qtConfig(tableview))
CONFIG -= app_bundle
LIBS += -LC:/OpenSSL-Win64/lib -lubsec
HEADERS += \
twitter.h \
twittertimelinemodel.h
INCLUDEPATH += C:/OpenSSL-Win64/include
SOURCES += \
main.cpp \
twitter.cpp \
twittertimelinemodel.cpp
FORMS += \
twitterdialog.ui
# install
target.path = $$[QT_INSTALL_EXAMPLES]/oauth/twittertimeline
INSTALLS += target
qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
qt.networkauth.replyhandler: TLS initialization failed
The error it keeps on returning.

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
}

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.

"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.