Important: Please read the Qt Code of Conduct -

qUncompress problem

  • Hi,
    I get the strange error with qUncompress but I don't know what is problem with my configuration.
    Here is my code:

    #include <QCoreApplication>
    #include <QByteArray>
    #include <QFile>
    #include <QDebug>
    int main(int argc, char *argv[])
        QCoreApplication a(argc, argv);
        QFile f("/user/XXXXXX/home/AgeRegression");
         if (f.exists())
              qDebug() << "File exists";
              qDebug() << "Missing file";;
        QByteArray qb = f.readAll();
        qb = qUncompress(qb);
        const char *qt_version = qVersion();
        qDebug()<< QString(qt_version);
        return a.exec();

    The file AgeRegression you can download from here.
    And here is result:

    File exists
    qUncompress: Z_DATA_ERROR: Input data is corrupted

    The interesting thing is the other people seems to don't have issues when they run it on MacOS or Ubuntu while mine is Fedora 19.
    Can someone see my problem and help me? Thank in advance.

    UPDATE: Now when I try with the file compressed by the file which was compressed by qCompress, I got the same issues.

Log in to reply