Important: Please read the Qt Code of Conduct -

Build qtdeclarative private auto tests

  • Hi i need to build auto tests for qtdeclarative module
    but i get linker errors when try to compile test in quick directory e.g.

    qtdeclarative/lib -lQt5Quick -lQt5Qml -lQt5Gui -lQt5Network -lQt5Test -lQt5Core -lGLESv2 -lpthread
    ../../../auto/quick/qquickflickable/tst_qquickflickable.cpp:762: error: undefined reference to 'QQuickTimeLine::isActive() const'
    ../../../auto/quick/qquickflickable/tst_qquickflickable.cpp:763: error: undefined reference to 'QQuickTimeLine::isActive() const'

    in pro file this test marked as private

    //your code here
        qquickdrag \
        qquickdroparea \
        qquickflickable \
        qquickflipable \
    !qtConfig(accessibility):QUICKTESTS -= qquickaccessible
    qtConfig(private_tests) {

    other test not in private part, building fine, every .so file is in place
    I know it because of using private headers but don`t know how to solve this linker errors, maybe some keys for rebuild declarative nodule itself

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Which version of Qt are you building ? On which platform ?

  • qt 5.8.1
    platform mer-project

  • Lifetime Qt Champion

    Then a silly question, are you sure you are using the right qmake before building the test ?

  • Thank you for trying to help, i solve my problem, i found that private class, had a macro Q_AUTOTEST_EXPORT and that macro is just Q_DECLARE_EXPORT, when i just add in .pro file DEFINES +=Q_AUTOTEST_EXPORT nothing was export in .so, but when i add it like DEFINES +="Q_AUTOTEST_EXPORT=Q_DECL_EXPORT" it work fine.

Log in to reply