Available OPC UA backend fails to load
-
Setup
Qt: 6.2.0
Qt Creator: 5.0.2
OS: WindowsIssue
I am trying to run the OPC UA viewer example. The backend plugin open62541 is present but fails to load (see application output below). I have installed the entirety of additional libraries (among them Qt OPC UA). Loading fails as soon as I press "Find Servers" in the application's GUI (the host adress is a valid OPC UA Server).Starting C:\Qt\Examples\Qt-6.2.0\opcua\build-opcuaviewer-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug\debug\opcuaviewer.exe ... "Creating PKI path 'C:/Qt/Examples/Qt-6.2.0/opcua/build-opcuaviewer-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug/debug/pki/trusted/certs': SUCCESS." "Creating PKI path 'C:/Qt/Examples/Qt-6.2.0/opcua/build-opcuaviewer-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug/debug/pki/trusted/crl': SUCCESS." "Creating PKI path 'C:/Qt/Examples/Qt-6.2.0/opcua/build-opcuaviewer-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug/debug/pki/issuers/certs': SUCCESS." "Creating PKI path 'C:/Qt/Examples/Qt-6.2.0/opcua/build-opcuaviewer-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug/debug/pki/issuers/crl': SUCCESS." qt.opcua.security: No client certificate found at "C:/Qt/Examples/Qt-6.2.0/opcua/build-opcuaviewer-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug/debug/pki/own/certs/opcuaviewer.der" . Application identity will be invalid. qt.opcua: Failed to load OPC UA plugin: "open62541" qt.opcua: Available plugins: QList("open62541") C:\Qt\Examples\Qt-6.2.0\opcua\build-opcuaviewer-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug\debug\opcuaviewer.exe exited with code 0
I should add that I commented out the line below (
MainWindow::setupPkiConfiguration
), since the generated paths looked odd and the application would fail to create the directories.#ifdef Q_OS_WIN //pkidir += "../"; #endif
However I do not think that this has an impact, since I created my own project aswell, with a few lines to try loading the backend, and the problem is the same. Working with plugins is a first for me, do I maybe have to build the plugin myself first? But why would it be flagged as available then?
Thanks in advance.
EDIT
I have set the QT_DEBUG_PLUGINS environment variable and this has given me additional info:Cannot load library C:\Qt\6.2.0\msvc2019_64\plugins\opcua\open62541_backendd.dll: The specified module could not be found.
However the .dll is present in the specified directory...
-
Did you or anyone ever get this one solved? I am trying to install the plugin too and got the exact same error.
Everything went OK in my mind on the install, only warning was
"
-- Looking for pthread.h - not found
-- Found Threads: TRUE
"
and then of course the missing uacpp, but I am using the open62541 too, so should not be a problem.The "open62541_backend.dll" is in the folder which it says it is not: "Debug: Cannot load library C:\Qt\6.2.2\msvc2019_64\plugins\opcua\open62541_backend.dll" I am using the profile build.
-
Although this topic is quite old now, in case someone stumbles across it - the "open62541_backend.dll" must be placed in the applications folder as it is in the Qt source folder so that the application can find it, so: <application- folder>/plugins/opcua/open62541_backend.dll
-
Sorry for resurrecting this, but in case anyone stumbles over the same issue I would like to help out. The issue was in fact not related to my application finding the plugin DLL (open62541_backend.dll), but finding another DLL which the plugin relies on. On my development machine I fixed the problem by adding Qt/bin and QtCreator/bin paths to my PATH environment variable (a bad idea in my opintion but it did the job).
However, while deploying I stumbled over this issue again, with the root cause being a bit harder to find this time. After some digging it turned out that the plugin relies on msvcr100.dll which is part of Microsoft Visual C++ 2010 Service Pack 1. So installing this (very old package) or shipping the dll as part of the application will fix the issue. The dll can be found in the system32 folder, not within the compiler directories.
For anyone else coming across a similar problem, tools like dependency walker and procmon will your best friend. Procmon showed me that once open62541_backend.dll was loaded, the application tried to find msvcr100.dll in many different locations without success.
-
-
Hi, I faced the same problem, failed to load OPC UA plugin:
qt.opcua: Failed to load OPC UA plugin: "open62541"
qt.opcua: Available plugins: QList("open62541")
Could not create clientI solved by putting libcrypto-3-x64.dll in the output build directory. Open62541_backend.dll depends on libcrypto-3-x64.dll, you can check it by using Dependency Walker tool.
My env: Qt 6.6.0, MSVC2019 64bit.