2

I have some code that should unzip a compressed file. That code worked for me before but now I installed a fresh Linux Ubuntu system and fresh QT 5.1.1 creator and that code doesn't work anymore. I installed also some required packages and it compiles without errors. Here are the relevant instructions with error result:

QuaZip zipArchive(filePath);
qDebug() << zipArchive.getZipError(); //error code 0
zipArchive.open(QuaZip::mdUnzip);
//23 error lines saying "QIODevice::read: WriteOnly device"
qDebug() << zipArchive.getZipError(); //error -1000
zipArchive.goToFirstFile();
// error: QuaZip::goToFirstFile(): ZIP is not open in mdUnzip mode

I wonder why this error is encountered. Is it because of some library missing or whatever?

P5music
  • 3,197
  • 2
  • 32
  • 81
  • Are you sure your quazip lirary is linked against Qt5? I had this very same error when I accidentally linked against quazip-qt4 from my Qt5 application. (I know this question is rather old, but maybe someone else will stumble upon it just like I did today) – Dominik Schmidt Feb 01 '15 at 17:33
  • @P5music I have the exact same error and symptoms than you :( – Jean-Michaël Celerier Jun 07 '16 at 07:40

0 Answers0