Important: Please read the Qt Code of Conduct -

Using QtDeclarative

  • Hi guys,

    I'm trying to use QtDeclarative within my project, but as soon as I include it on the .pro file and try to build it I get the following error:

    :: error: cannot find -lQtDeclarative
    :: error: collect2: ld returned 1 exit status

    Here is my .pro file entry to use Qt Declarative:

    QT += core gui phonon declarative

    I run it under QtCreator 2.0.1.

    Does anybody have any idea why I am not able to use it?
    It may look somehow to obvious for many of you but I couldn't find out why yet.


  • What you have done is correct. There must be something else wrong. Perhaps it is accessing an earlier version (<4.7) of Qt, the Qt installation is bad, etc.

  • There was no previous Qt Creator installed in my system. Is there any way to download the declarative module and then install it?
    I believe this module was supposed to come with Qt Creator, like the phonon module - which works, by the way.

  • You can get the latest Qt SDK from

Log in to reply