Important: Please read the Qt Code of Conduct -

How to setup opcuaviewer example in QtCreator

  • Hi I'm trying to set up the opcuaviewer example in QtCreator in ubuntu 18.04.4 w Qt5.12 but I seem to have come across two issues:

    1. is that after compiling the opcua module in my local directory I have these:
    jchan@jchan-Z170N:~/Qt5.12.6/5.12.6/gcc_64/lib$ ls -la *OpcUa*
    -rw-r--r-- 1 jchan jchan      742 Feb  5 17:44
    -rw-r--r-- 1 jchan jchan     1213 Feb  5 17:44 libQt5OpcUa.prl
    lrwxrwxrwx 1 jchan jchan       21 Feb  5 17:44 ->
    lrwxrwxrwx 1 jchan jchan       21 Feb  5 17:44 ->
    lrwxrwxrwx 1 jchan jchan       21 Feb  5 17:44 ->
    -rwxr-xr-x 1 jchan jchan  1028576 Feb  5 17:43
    -rw-r--r-- 1 jchan jchan 13759248 Feb  5 17:43

    but in qtcreator it seems to not be able to find my opcua module:

    1. the examples that i've copied and pasted from here:
      don't seem to have a ui_certificatedialog.h
      which is referenced in certificatedialog.cpp. Could I be missing some of the example files if so where would I get them or is this something that I should be implementing my self?

  • Lifetime Qt Champion

    @James-Mark-Chan Your LIBS in pro file does not contain actual lib. It should be:

    LIBS += -LPATH_TO_LIB_DIR -lQt5OpcUa

    ui_certificatedialog.h will be generated when compiling.

  • Thank you for this post. I just discovered that I should have been using the examples from the qt clone instead of manually copying the text from the web url and it seems no LIBS += ... line was even needed as my creator was configured to use the default kit. It is launching now. I do wonder why my objects under the device folder node are not showing and will be looking into it.

Log in to reply