Qt World Summit: Register Today!

undefined reference error to QsystemstorageInfo

  • error: undefined reference to QtMobility::QSystemStorageInfo::QSystemStorageInfo(QObject*) error: undefined reference toQtMobility::QSystemStorageInfo::logicalDrives()' error: undefined reference to QtMobility::QSystemStorageInfo::totalDiskSpace(QString const&)' error: undefined reference toQtMobility::QSystemStorageInfo::~QSystemStorageInfo()'
    error: undefined reference to `QtMobility::QSystemStorageInfo::~QSystemStorageInfo()'
    :-1: error: collect2: error: ld returned 1 exit status

  • Hi and welcome to devnet,

    which version of Qt are you using? Which platform?

    No one has a crystal ball so you have to provide more information if you want help

  • Hi iam using Qt 5.5 on Ubuntu 14.04 OS.

    I have installed both QtMobility and QStorageInfo and accessed them by including them in the .pro file as well as i have included them in include paths in the project properties, but still iam not able to access them properly.

    And when i saw in the folder QStorageInfo it has only header files, there is no code in them.

    Do i need to install anthing?

  • Lifetime Qt Champion

    @Ravimettu Can you show your PRO file? It looks like you don't link against QtMobility libraries.

  • I have included them by using following lines.

    CONFIG += mobility
    MOBILITY += systeminfo

    INCLUDEPATH += /usr/include/QtMobility
    INCLUDEPATH += /usr/include/QtSystemInfo

  • The same code worked in 12.04 with Qt 4.8 but after migrating to Qt 5.5 and ubuntu 14.04 it got this error

  • I have installed Qt in opt. Is it ok? or i should install it in /usr/share

  • Hi,

    as far as I know, QtMobility is not maintained in Qt 5.5; some classes was ported and included in Qt

  • yes i agree

  • But i see only header files in the QSystemInfo package and in QtMobility
    there are no .Cpp files or .so libraries

Log in to reply