1

I'm not a Windows user but I'm trying to help port a QT project into Windows that's running into some rather strange issues (to me, anyway). I hope someone can help point me in the right direction.

So, I can successfully build the project on a Windows 7 professional 32 bit machine (QT 5.1.1, MinGW 4.8.1, exiv2). While everything works on the build machine, the program crashes on some machines (so far, it's crashed on a 64 bit Windows 7 professional and another 32 bit Windows 7) but works on others. The crash message is not all that useful as it's a generic StackHash / APPCRASH error. I tried changing the DEP settings but that wasn't useful (and I'm not sure I would accept that as a 'solution'). I narrowed down the place where the crash occurs (thankfully that is consistent) and an example snippet (read jpeg files in a folder and print their timestamp) is below.

Calling any function in exiv2 (exiv2-12.dll) will cause the program to crash



    Exiv2::Image::AutoPtr exiv = Exiv2::ImageFactory::open(imagePath);
    exiv->readMetadata();
    Exiv2::ExifData data = exiv->exifData();
    Exiv2::Value::AutoPtr v = Exiv2::Value::create(Exiv2::asciiString);;
    if      (data.findKey(dateTimeOriginal) != data.end())
        v = (data.findKey(dateTimeOriginal))->getValue();
    else if (data.findKey(dateTimeDefault ) != data.end())
        v = (data.findKey(dateTimeDefault ))->getValue();
    QString dateTime(v->toString().c_str());
    this->ui->plainTextEdit->appendPlainText("\n" + dateTime);

Any help would be very much appreciated.

  • Are you catching the exceptions? According to exiv2 docs, several of those functions (ImageFactory::open(), readMetaData()) throw. – Frank Osterfeld Nov 13 '13 at 23:57
  • Yes. I do have a catch-all as well, but no exceptions are being thrown. I think it's related to loading of exiv2 DLL (?) because I don't see a module name in the crash report. But that still doesn't help much because it works on some windows machines and not on some! I'm at my wits end. :-) – user2989419 Nov 14 '13 at 05:02

1 Answers1

1

Ok, I've resolved this. Turned out that exiv2 was compiled with a different version of gcc from what Qt was using. So, I had to recompile everything using the same compiler. The most compatible version was 4.4 for all the libraries that the project is using, so I had to downgrade to Qt-4.8.5 and link everything statically.

I'm still not sure why it would work on some machines and not on some though. :)