Important: Please read the Qt Code of Conduct -


  • I am not very familiar with how to incorporate predefined constants into a pro file. I have a lot of code written for QT and I am trying to incorporate the source from OpenSCADA into my project. I have encountered some problems relating to prepossessing. In the OpenSCADA there are the following constants used throughout the code:

    I take it they are version control strings used for distribution. I have tried using "#define" statements in a .config file and "DEFINES+=" statements in the project file. An example of the error:

    "error: expected ‘;’ before ‘PACKAGE_NAME’"

    "  <title>" PACKAGE_NAME ": " + SYS->id() + "</title>\n"

    I have tried the defines as '#define PACKAGE_NAME "Test"' and '#define PACKAGE_NAME +"Test"+', what am I doing wrong?


  • @CrazyDave
    Note that double commander cannot find these constants anywhere in the OpenSCADA source other than inline in the code.

  • Lifetime Qt Champion

    The #DEFINEs +=
    is the way to do it.

    maybe the errors was due to incorrect escaping ?

Log in to reply