qtqt-creatoropc-uaqt6qtopcua

Can't run the Qt OPC UA example


I have imported the example project available in the oficial docs and tried to build it but it fails on the find package step with the following message

[cmake] CMake Error at CMakeLists.txt:17 (find_package):
[cmake]   Found package configuration file:
[cmake] 
[cmake]     C:/Qt/6.5.3/mingw_64/lib/cmake/Qt6/Qt6Config.cmake
[cmake] 
[cmake]   but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
[cmake]   FOUND.  Reason given by package:
[cmake] 
[cmake]   Failed to find required Qt component "OpcUa".
[cmake] 
[cmake]   Expected Config file at
[cmake]   "C:/Qt/6.5.3/mingw_64/lib/cmake/Qt6OpcUa/Qt6OpcUaConfig.cmake" does NOT
[cmake]   exist

I tried checking the documentation to see if I was missing any steps but all I found was that:

"The stacks are integrated as plugins and can be selected at runtime."

How? as far as I know it means the component required part but it's where the cmake fails

"The Open62541 plugin is built by default from the included 3rd party sources and has no external dependencies."

But I did not find it on plugins nor in the maintenance tool..

The folder "Qt6OpcUa" at "C:/Qt/6.5.3/mingw_64/lib/cmake" really is missing, but I have multiple other folders there for Qt6OpenGL, Qt6Linguist, Qt6Gui.... so maybe it's a missing step on installation? Is this component only available for the paid version of QT? Do I need to pass a special parameter to cmake? Does it need to be downloaded from somewhere? I'm really lost here...

I have received a message on QT forum stating that it need to be downloaded with the maintenance tool: https://forum.qt.io/topic/161652/can-t-run-the-qt-opc-ua-example?_=1744379664883

but I couldn't find the module on the maintenance tool, does it have another name? It's under which section? Is it not available to open source projects?

This are the extensions avaliable to me:

5232bb40-0569-458a-9856-d702c730a448-image.png

There are also the additional libraries under my QT version:

daabe5e0-14a2-4a91-afa6-2c0f13fde308-image.png

be2d950f-46fd-4890-b398-7ee3ce741959-image.png


Solution

  • Aha! found what I was looking for on a old blog post!

    Qt OPC UA will be available directly from the Qt installer for those holding a Qt for Automation license. [...] Users of one of the Open Source licenses will need to compile Qt OPC UA themselves. See here for a list of build recipes.

    this really should be clearly stated on documentation...