qt6.7.2 opcua
-
I have some problem on debian 12 ... now seems all solved, but still remain problem with opcua based on open62541 .... version installed at user level (like qt6.7.2) is 1.4.4 ... the last.
actually after a lot of modification of my code, I try to run test-server on qopcua folder ..... and app not compile with these
error: /usr/bin/ld: testserver.o: in function `TestServer::addEncoderTestModel()': testserver.cpp:(.text+0x1009): undefined reference to `namespace_qtopcuatestmodel_generated' /usr/bin/ld: testserver.cpp:(.text+0x114a): undefined reference to `UA_TYPES_QTOPCUATESTMODEL'
not understand what happens ... And would know if something is buggy .... or I make somethings wrong....
my config summary is these:
Qt Opcua: Open62541 .............................. yes Support for namespace 0 NodeId names ... yes Internal code generator ................ no Open62541 security support ............. yes Support for global discovery server .... yes Data type code generator ............... yes
All error received on my compiling time on my app was concerned error linking library or header not well compose .... but think really is some other .... at least my app run only a reduce and modified version of simpleserver example .h and .cpp file.
But if not run TestServer think is not good try to modify my app. Error is not on code (or not only on code).
Any help is appreciate
-
Please show your pro file or CMakeLists.txt. It looks like you're not linking a library (undefined reference). From where does namespace_qtopcuatestmodel_generated come?
-
@jsulm in few time share my .pro file (i'm not in front of that pc now) ... after these I try to re-install all using open62541 v1.3.9 like support from qt6.7.2.... these time try to use ninja instead cmake or cmke-gui for qtopcua glue.... and find error related x509 support .... with ninja qtopcua compile with warning related to x509 but not install at all .... with cmake you see the result ... but have namespace_qtopcuatestmodel_generated never see before .... I use debian 12 so impossible to install libopen62541-dev or mere update lib from repo (that repo not exist in debian 12, maybe in older version 10 o 11).
so here my .pro
#--------------------------------------------------------------------------- # # Project created by QtCreator 2022-01-12T12:11:31 - note is an old project # #--------------------------------------------------------------------------- QT += core gui widgets sql network multimedia multimediawidgets designer charts webenginewidgets webview opcua opcua-private CONFIG += c++17 CONFIG += use_gold_linker #CONFIG += system-open62541 #CONFIG += use_lld_linker TARGET = mck_opcua65 TEMPLATE = app #DEFINES += QT_DEPRECATED_WARNINGS DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x050F00 # disables all the APIs deprecated before Qt 6.0.0 #QT_PLUGIN_PATH += /home/dmx/Qt/Tools/QtCreator/lib/Qt/plugins/designer #INCLUDEPATH += $$PWD/../../../../../../data/plc \ INCLUDEPATH += /usr/include INCLUDEPATH += /usr/local/lib INCLUDEPATH += /home/dmx/Qt/6.7.2/gcc_64/include INCLUDEPATH += /usr/lib INCLUDEPATH += /usr/lib/x86_64-linux-gnu INCLUDEPATH += /home/dmx/Qt/Tools/QtCreator/lib/Qt/plugins/designer INCLUDEPATH += /home/dmx/progetti/wled-designer-plugin INCLUDEPATH += /home/dmx/progetti/mc_opcua65/resources INCLUDEPATH += /home/dmx/progetti/mc_opcua65/src/3rdparty/open62541 INCLUDEPATH += /home/dmx/progetti/mc_opcua65/src/3rdparty/ INCLUDEPATH += /home/dmx/progetti/mc_opcua65/src/ INCLUDEPATH += /home/dmx/Qt/6.7.2/Src/qtopcua/src/plugins/opcua/open62541/ INCLUDEPATH += /home/dmx/Qt/6.7.2/Src/qtopcua/src/3rdparty/ INCLUDEPATH += /home/dmx/Qt/6.7.2/Src/qtopcua/src/3rdparty/open62541/ INCLUDEPATH += /home/dmx/Qt/6.7.2/Src/qtopcua/src/opcua/client/ INCLUDEPATH += /home/dmx/Qt/6.7.2/Src/qtopcua/src/opcua/ INCLUDEPATH += /home/dmx/Qt/6.7.2/Src/qtopcua/examples/opcua/ INCLUDEPATH += /home/dmx/Qt/6.7.2/gcc_64/plugins INCLUDEPATH += /home/dmx/Qt/6.7.2/gcc_64/lib INCLUDEPATH += /home/dmx/Qt/6.7.2/gcc_64/modules INCLUDEPATH += /home/dmx/qtopcua/src/3rdparty/open62541 INCLUDEPATH += /home/dmx/qtopcua/src/plugins/opcua/open62541 #!exists($$MODULE_SOURCES):{ #Build from source tree # MODULE_SOURCES=/home/dmx/qtopcua/src/3rdparty #} INCLUDEPATH += \ $$PWD/src/plugins/opcua/open62541 #LIBS+=-L /home/dmx/Qt/Tools/QtCreator/lib/Qt/plugins/designer -lhalwidgetsplugin LIBS += -lGLU -lGL LIBS += -Iinclude LIBS += -L/usr/local/lib/libopen62541.so QMAKE_CXXFLAGS += -Wno-unused-variable QMAKE_CXXFLAGS += -Wno-unused-parameter QMAKE_CXXFLAGS += -Wunused-but-set-variable #DEPENDPATH += INCLUDEPATH qtConfig(open62541):!qtConfig(system-open62541) { include(/home/dmx/qtopcua/src/3rdparty/open62541.pri) } else { QMAKE_USE_PRIVATE += open62541 } SOURCES += \ WLED.cpp \ adduser.cpp \ beccircularprog.cpp \ becdia2.cpp \ diatraspwin.cpp \ donutbreakdownchart.cpp \ gcopcuaserver.cpp \ global_const_comm.cpp \ helpcobot.cpp \ helpgraphic.cpp \ helphome.cpp \ highlightrectitem.cpp \ highlightrectitemh.cpp \ login.cpp \ main.cpp \ mainslice.cpp \ mainwindow.cpp \ qledv.cpp \ qtoggleableqlabel.cpp \ rettangolo.cpp \ $$PWD/src/plugins/opcua/open62541/qopen62541utils.cpp \ $$PWD/src/plugins/opcua/open62541/qopen62541valueconverter.cpp HEADERS += \ StdNameData.h \ WLED.h \ adduser.h \ beccircularprog.h \ becdia2.h \ boxStdData.h \ diatraspwin.h \ donutbreakdownchart.h \ gcBusBoxData.h \ gcopcuaserver.h \ get_command.h \ global_const_comm.h \ hal_priv.h \ helpcobot.h \ helpgraphic.h \ helphome.h \ highlightrectitem.h \ highlightrectitemh.h \ login.h \ mainslice.h \ mainwindow.h \ qledv.h \ qtoggleableqlabel.h \ rettangolo.h \ send_command.h FORMS += \ adduser.ui \ bmecdia2.ui \ diatraspwin.ui \ helpcobot.ui \ helpgraphic.ui \ helphome.ui \ login.ui \ mainwindow.ui RESOURCES += \ stylessheet.qrc #install target.path = /home/dmx/progetti/mc_opcua65/mc_opcua65 INSTALLS += target
-
@gfxx There are so many issues in your pro file. Most of the INCLUDES are not needed (there is no point to add system include folders like /usr/include and it is also not needed to add Qt include folders).
What is this: LIBS += -Iinclude ?!
This is wrong:
LIBS += -L/usr/local/lib/libopen62541.so
Has to be:
LIBS += -L/usr/local/lib -lopen62541
The error message you posted is from testserver.cpp - there is nothing like this in the pro file you posted. So, please post the pro file building testserver.cpp.
-
@jsulm you are in right ... real sorry ... LIBS += -Linclude is an error ... not see previous ... but maybe there an # not copy on file.
LIBS += -L/usr/local/lib -lopen62541
these is an other error .... but depends from I'm desperate and work on these until 4am from 8am of days previous (20 hour no stop working) ... so "morpheus" make me some joke I think.
I post later my testserver.pro file .... sorry but I'm totally caught up in this thing... it's never happened to me that I didn't resolve an "upgrade" in more than 2-3 days. This is getting serious and forcing me to study much more than I have ever done before regarding Debian world.
these the code used for test server ....
TEMPLATE = app TARGET = open62541-testserver INCLUDEPATH += \ $$PWD/../../src/plugins/opcua/open62541 DEPENDPATH += INCLUDEPATH CONFIG += c++11 console QT += opcua-private qtConfig(open62541):!qtConfig(system-open62541) { qtConfig(mbedtls):{ QMAKE_USE_PRIVATE += mbedtls DEFINES += UA_ENABLE_ENCRYPTION UA_ENABLE_ENCRYPTION_MBEDTLS } include($$PWD/../../src/3rdparty/open62541.pri) } else { QMAKE_USE_PRIVATE += open62541 } win32: DESTDIR = ./ # Workaround for QTBUG-75020 QMAKE_CFLAGS_RELEASE -= -O2 QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO -= -O2 SOURCES += \ main.cpp \ testserver.cpp \ $$PWD/../../src/plugins/opcua/open62541/qopen62541utils.cpp \ $$PWD/../../src/plugins/opcua/open62541/qopen62541valueconverter.cpp HEADERS += \ testserver.h RESOURCES += certs.qrc
regards
-
@jsulm really not .... after some test I see open62451 v1.3.9 permit to compile qtopcua on older version like debian 10 .... for debian 12 only open62451 v1.4 seems permitt to qtopcua to end the compilation time with success .... so now try to install again open62451 "master" branch. After chek try again to compile test-server .... than see the result and post.
After use Ninja, I try to install with cmake qtopcua module .... without success ....before to try, i cancell al my installation folder (I install as user permission), power on and power off ... than use online installer again, again install qtopcua as suggest from "basiskom" blog .... but have error during compilation time .... so in my opinion these means that these version is not so good for debian 12.
regards
-
@gfxx now try to compile with amalgamation off open62541 ..... qropcua stop make process at 1% with error ..... so try to compile open62541 with amalgamation on ..... and receive these error ...
[ 20%] Building CXX object src/opcua/CMakeFiles/OpcUa.dir/client/qopcuagenericstructhandler.cpp.o [ 20%] Building CXX object src/opcua/CMakeFiles/OpcUa.dir/client/qopcuagenericstructhandlerprivate.cpp.o /home/gc51/qtopcua/src/opcua/client/qopcuagenericstructhandlerprivate.cpp:953:1: internal compiler error: Segmentation fault 953 | } | ^ 0x1afaeb6 internal_error(char const*, ...) ???:0 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <file:///usr/share/doc/gcc-12/README.Bugs> for instructions. make[2]: *** [src/opcua/CMakeFiles/OpcUa.dir/build.make:682: src/opcua/CMakeFiles/OpcUa.dir/client/qopcuagenericstructhandlerprivate.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:1255: src/opcua/CMakeFiles/OpcUa.dir/all] Error 2 make: *** [Makefile:146: all] Error 2 mypc51@mint51:~/qtopcua/build$
try install qtopcua using libopen62541.so only without install open62541 ....
-
@gfxx so try to leave out folder open62541 and use only generated libopen62541.so .....
these step for qropcua:
git clone https://code.qt.io/qt/qtopcua.git cd qtopcua git checkout 6.7.2 mkdir build && cd build ~/Qt/6.7.2/gcc_64/bin/qt-cmake .. make
result of ~/Qt/6.7.2/gcc_64/bin/qt-cmake .. :
-- Found WrapAtomic: TRUE -- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so -- Found WrapOpenGL: TRUE -- Found XKB: /usr/lib/x86_64-linux-gnu/libxkbcommon.so (found suitable version "1.5.0", minimum required is "0.5.0") -- Found WrapVulkanHeaders: /usr/include CMake Warning at /home/gc51/Qt/6.7.2/gcc_64/lib/cmake/Qt6/QtBuildHelpers.cmake:12 (message): The officially supported CMake generator for building Qt is Ninja / Ninja Multi-Config. You are using: 'Unix Makefiles' instead. Thus, you might encounter issues. Use at your own risk. Call Stack (most recent call first): /home/gc51/Qt/6.7.2/gcc_64/lib/cmake/Qt6/QtBuildHelpers.cmake:381 (qt_internal_validate_cmake_generator) /home/gc51/Qt/6.7.2/gcc_64/lib/cmake/Qt6/QtBuild.cmake:4 (qt_internal_setup_build_and_global_variables) /home/gc51/Qt/6.7.2/gcc_64/lib/cmake/Qt6/QtSetup.cmake:6 (include) /home/gc51/Qt/6.7.2/gcc_64/lib/cmake/Qt6/QtBuildRepoHelpers.cmake:21 (include) /home/gc51/Qt/6.7.2/gcc_64/lib/cmake/Qt6/QtBuildRepoHelpers.cmake:179 (qt_build_internals_set_up_private_api) /home/gc51/Qt/6.7.2/gcc_64/lib/cmake/Qt6/QtBuildRepoHelpers.cmake:497 (qt_build_repo_begin) CMakeLists.txt:29 (qt_build_repo) -- Force setting build type to 'RelWithDebInfo'. -- Configuration summary shown below. It has also been written to /home/gc51/qtopcua/build/config.summary -- Configure with --log-level=STATUS or higher to increase CMake's message verbosity. The log level does not persist across reconfigurations. -- Configure summary: Qt Opcua: Open62541 .............................. yes Support for namespace 0 NodeId names ... yes Internal code generator ................ no Open62541 security support ............. yes Support for global discovery server .... yes Data type code generator ............... yes -- Configuring done -- Generating done -- Build files have been written to: /home/gc51/qtopcua/build
result of make:
[ 20%] Building CXX object src/opcua/CMakeFiles/OpcUa.dir/client/qopcuagenericstructhandler.cpp.o [ 20%] Building CXX object src/opcua/CMakeFiles/OpcUa.dir/client/qopcuagenericstructhandlerprivate.cpp.o /tmp/cchYtRhA.s: Assembler messages: /tmp/cchYtRhA.s:903754: Error: unknown pseudo-op: `.lofg' /tmp/cchYtRhA.s:903755: Error: no such instruction: `nbyta 0x2' /tmp/cchYtRhA.s:903944: Error: unknown pseudo-op: `.lon' /tmp/cchYtRhA.s:911058: Error: unknown pseudo-op: `.nong' /tmp/cchYtRhA.s:913593: Error: junk at end of line, first unrecognized character is `[' /tmp/cchYtRhA.s:913607: Error: invalid character (0xae) in mnemonic /tmp/cchYtRhA.s:913670: Error: unknown pseudo-op: `.lonw' /tmp/cchYtRhA.s:930545: Error: unknown pseudo-op: `.�ong' /tmp/cchYtRhA.s:930546: Error: junk at end of line, first unrecognized character valued 0x1 /tmp/cchYtRhA.s:1617274: Error: unknown pseudo-op: `.6alue' /tmp/cchYtRhA.s:1617275: Error: unknown pseudo-op: `.qu100' /tmp/cchYtRhA.s:1632261: Error: unknown pseudo-op: `.l' /tmp/cchYtRhA.s:1632262: Error: unknown pseudo-op: `.�ong' /tmp/cchYtRhA.s:904199: Error: leb128 operand is an undefined symbol: tx3 make[2]: *** [src/opcua/CMakeFiles/OpcUa.dir/build.make:682: src/opcua/CMakeFiles/OpcUa.dir/client/qopcuagenericstructhandlerprivate.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:1255: src/opcua/CMakeFiles/OpcUa.dir/all] Error 2 make: *** [Makefile:146: all] Error 2
-