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.
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. :)