Unable to compile when using QtDeclarative



  • If I make an instance of QDeclarativeView my code is unable to compile and I get the following errors.

    @c:\Qt\qt-everywhere-opensource-src-4.7.0-rc1\lib/libQtDeclarative.a(qdeclarativevaluetype.o):qdeclarativevaluetype.cpp:(.text+0x4c8): undefined reference to `_imp___Z13qt_defaultDpiv'

    c:\Qt\qt-everywhere-opensource-src-4.7.0-rc1\lib/libQtDeclarative.a(qdeclarativevaluetype.o):qdeclarativevaluetype.cpp:(.text+0x552): undefined reference to `_imp___Z13qt_defaultDpiv'

    collect2: ld returned 1 exit status@

    Source:

    @#include <QApplication>
    #include <QtDeclarative/QDeclarativeView>

    int main(int argc, char * argv[])
    {
    QApplication app(argc, argv);
    QDeclarativeView view;

    return app.exec();
    }
    @

    Qmake project file

    @QT += declarative gui
    TEMPLATE = app
    TARGET =
    DEPENDPATH += .
    INCLUDEPATH += .

    Input

    SOURCES += main.cc@

    Does anyone have an idea what might be wrong? By the way I compiled qt statically if this has any impact.



  • Hi

    Wich Qt version and compilator you use?



  • Version 4.7.0-rc1 and mingw (gcc 4.4.1-tdm-2)


  • Moderators

    What is the demangled symbol name that is missing? Run @c++filt _imp___Z13qt_defaultDpiv@ to find out:-)



  • [quote author="Tobias Hunger" date="1283943033"]What is the demangled symbol name that is missing? Run @c++filt _imp___Z13qt_defaultDpiv@ to find out:-)[/quote]

    I just get the same string back.



  • This should now be fixed in the qt-qml staging branch (commit 0537750396ea519bbdf2b0fed086d535fc8c53b7).



  • [quote author="mbrasser" date="1284604738"]This should now be fixed in the qt-qml staging branch (commit 0537750396ea519bbdf2b0fed086d535fc8c53b7).[/quote]

    Thanks, this solved the issue. I ran into 1 or 2 similar errors while building other modules and used the same fix to solve it.



  • Great! Any chance you can raise a bug in the "tracker":http://bugreports.qt.nokia.com detailing what else needs to be fixed to compile correctly?

    Thanks,
    Michael



  • [quote author="mbrasser" date="1285027768"]Great! Any chance you can raise a bug in the "tracker":http://bugreports.qt.nokia.com detailing what else needs to be fixed to compile correctly?

    Thanks,
    Michael[/quote]

    There were already a couple of issues but none of them had fixed for all the issues so I created a new one.

    "http://bugreports.qt.nokia.com/browse/QTBUG-13767":http://bugreports.qt.nokia.com/browse/QTBUG-13767



  • Hmmm..... I'm having a similar issue using QT 4.7.0 with GCC 4.4.0, so I guess this wasn't fixed in the final release after all :(

    After compiling statically (configure -static -release) I get the following error when issuing mingw32-make:

    @g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
    oc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o ....\bin\qmlviewer.exe object
    _script.qmlviewer.Release -L"d:\dev\qt\qt\lib" -L"d:\dev\qt\qt\lib" -lmingw32 -
    lqtmain -lQtDeclarative -lQtScript -lQtSvg -lQtSql -lQtXmlPatterns -lQtOpenGL -l
    glu32 -lopengl32 -lQtGui -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspoo
    l -lmsimg32 -lQtNetwork -lQtCore -lkernel32 -luser32 -lshell32 -luuid -lole32 -l
    advapi32 -lws2_32
    d:\dev\qt\qt\lib/libQtDeclarative.a(qdeclarativevaluetype.o):qdeclarativevaluety
    pe.cpp:(.text+0x391): undefined reference to _imp___Z13qt_defaultDpiv' d:\dev\qt\qt\lib/libQtDeclarative.a(qdeclarativevaluetype.o):qdeclarativevaluety pe.cpp:(.text+0x408): undefined reference to_imp___Z13qt_defaultDpiv'
    collect2: ld returned 1 exit status
    mingw32-make[3]: *** [....\bin\qmlviewer.exe] Error 1
    mingw32-make[3]: Leaving directory D:/dev/qt/qt/tools/qml' mingw32-make[2]: *** [release] Error 2 mingw32-make[2]: Leaving directoryD:/dev/qt/qt/tools/qml'
    mingw32-make[1]: *** [sub-qml-make_default-ordered] Error 2
    mingw32-make[1]: Leaving directory `D:/dev/qt/qt/tools'
    mingw32-make: *** [sub-tools-make_default-ordered] Error 2@

    Any advice?



  • Perhaps it wasn't included in the release. If you get the tar ball from gitorious it probably works. "http://qt.gitorious.org/qt/qt/archive-tarball/4.7":http://qt.gitorious.org/qt/qt/archive-tarball/4.7


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.