Cmake Qt package not found
-
Goodday everyone!
I'm very new to Qt and I bumped into a following problem:
I have a Programm Logic Control that uses OPC UA protocol for data transfer. Now I must write a programm (client) to get data from the PLC (server) but when I try to use QOpcUaClient Class (https://doc.qt.io/qt-6/qopcuaprovider.html) Qt Creator shows this error: Qt6OpcUaConfig.cmake does not exist. What should I do in order for this library to appear and work?I istalled Qt with Qt Creator with all default settings that were alreasy choosen.
-
Please rather paste code than screenshots. It is much easier to see and copy-paste when replying.
OPC UA module is an additional module. Please launch "Qt Maintenance" application, then "Add remove components", then select your Qt version and inside of it click on "Additional libraries". Lastly, check "Qt OPC UA". Proceed in the wizard, rebuild your project (run cmake, build) and it should work.
file:///home/sierdzio/Pictures/Screenshot_20240206_121139.png
-
@sierdzio
Please rather paste code than screenshots. It is much easier to see and copy-paste when replying.
Okay, I'll keep that in mind.Unfortunately, I don't have it in this list
I installed Qt from here, as an open source version software for Windows 10: https://www.qt.io/download-open-source
-
@kyakovlev hm that is odd, this module is not exclusive to commercial licensees, so it should show up also in open source installer:
The Qt OPC UA module is available under commercial licenses from The Qt Company. In addition, it is available under free software licenses. These free software licenses are GNU Lesser General Public License, version 3, or the GNU General Public License, version 2.
I don't know what's the issue, sorry! Try asking on Qt Interest mailing list perhaps.
-
Okay, I managed to figure it out. Yes, this module is not available if using open source version of Qt but one can build it manually from source components and use.
This instruction helped me a lot: https://linzichun.com/posts/qt-mqtt-opcua-modbus-rest/#qt-opc-ua
Be ready to read the console, download some other missing stuff to your platform and repeat the same command, however. I needed to install about 4-5 missing utilities during the proccess.
-