Building QFreeOpcUaPlugin and QOpen62541Plugin plugins Qt 5.10
-
I have an OPC UA server. I need to implement OPC UA Client. I'm working in QtCreator 4.5.0 on Qt 5.10.0 (MinGW 32 bit Win10 64x). For my purpose, I want to use the qtopcua component. I assembled and installed the component from the sources to github using the command sequence, qmake, mingw32-make, mingw32-make install. Now, if I add Qt + = opcua to the .pro file of my project, the project is successfully compiled. However, when I try to run the example that comes with the qtopcua source, it turned out that it requires QFreeOpcUaPlugin and QOpen62541Plugin plugins to work for it. Makefiles for these plugins come with the source code qtopcua. During execution of mingw32-make, the Makefile generated .cpp and .h. Now I need to install plugins in mingw \ plugins. I tried to compile the source code of the plugins in QtCreator. But I encountered dependencies. In the file open62541.pro the line "win32: LIBS + = open62541.lib ws2_32.lib" I put open62541.lib in the build folder, but when compiling I get the error: "Library 'open62541' is not defined". The QFreeOpcUaPlugin plugin is dependent on the boost and freeopcua libraries, so also compiles with errors. How can I correctly build and install these plugins? Many thanks.
-
Hi and welcome to devnet,
Did you get all the dependencies ? If so, did you get them for the compiler you are using ?
-
I commented out the line
QMAKE_USE_PRIVATE + = open62541
in the open62541.pro file. After that, the error disappeared. But I have got another mistake:C: \ qtopcua-dev \ src \ plugins \ opcua \ open62541 \ qopen62541backend.cpp: 366: error: 'UA_ClientConfig_default' was not declared in this scope
m_uaclient = UA_Client_new (UA_ClientConfig_default); -
When I try to build a plugin QFreeOpcUaPlugin, I get a set of errors:
undefined reference toOpcUa::UaClient::GetNode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' undefined reference to
OpcUa::Node::Node(OpcUa::Node const&)'
undefined reference toOpcUa::NodeId::NodeId()' undefined reference to
OpcUa::Node::GetId() const'
undefined reference toOpcUa::Node::GetChildren() const' undefined reference to
OpcUa::Node::GetId() const'
.........
I do not understand what I need to add, what is missing. -
The libraries from the backend you want to use. i.e.: open62541 or FreeOpcUa.
-
Now I got open62541_backend.dll, open62541_backendd.dll and libs in mingw53_32\plugins\opcua. But when I try to to compile example - project "accontrol" I got an error: E:\PROJECTS\accontrol\accontroltest.cpp:54: QtOpcUa/QOpcUaMonitoredValue: No such file or directory.
QOpcUaMonitoredValue class is missing in the source qtopcua-dev... Any ideas, please... -
Base on this commit, I'd say the example hasn't been update yet.
-
Hi guays,
I am at the same staep as you. I have done the steps qmake, mingw32-make, mingw32-make install.
And then I have the same problem with the open62541 and freeopcua.My question is now, how do you get the open62541_backend.dll, open62541_backendd.dll and libs?
Many thanks in advance!
Greetings
-
Hi,
AFAIK, build the corresponding project.
-
@SGaist You are right. The API is currently settling down. There will be a Tech Preview in Qt 5.11. The examples you currently find on the dev branch are outdated. New examples are in the pipeline. You can find the first here: https://codereview.qt-project.org/#/c/216519/
-
@N3ff3 please have a look at this article:
https://blog.basyskom.com/2018/want-to-give-qt-opcua-a-try/You should go with the open62541 backend. Open62541 is the more complete implementation and has a much more active community.
Note that open62541 will release their 0.3 version in the next few weeks. We plan to use this release in the Tech Preview in Qt 5.11.
-
@fmeerkoetter
thank you very much for the information and the link.Now I am testing the QtOpcUa. For this I use the Softing OPC UA .net Demo Server. The Problem is, that I can't connect to the server. I get this error message:
error/client No suitable UserTokenPolicy found for the possible endpoints
After reading the docs of QtOpcUa, I can't find anything about the Policy.
Is there anything which I can use?
Best regards
N3ff3 -
@fmeerkoetter said in Building QFreeOpcUaPlugin and QOpen62541Plugin plugins Qt 5.10:
@N3ff3 please have a look at this article:
https://blog.basyskom.com/2018/want-to-give-qt-opcua-a-try/ https://cheapessaywriter.net/You should go with the open62541 backend. Open62541 is the more complete implementation and has a much more active community.
Note that open62541 will release their 0.3 version in the next few weeks. We plan to use this release in the Tech Preview in Qt 5.11.
I read that open62541 is the most stable and feature complete open source backend presently in Qt OPC UA so you won't experience any difficulties.