Saturday, November 22, 2008

crashfixing

As I was working on digikam porting recently I made some first packages - and of course those were not even starting up. Well, to be a bit clearer: the packages build with msvc (Microsoft Visual Studio) crashed both in
png_read_info
for png images and in
jpeg_read_header
for libjpeg. This seemed to be rather odd I thought, as there seemed to be a lot of applications using these libraries for image i/o. But as I found out, most don't use our dll but instead a static version of it. That wasn't an option for me though.

To understand the crashes a bit more I found a good explanation here. Basically the problem is that msvc will link to different runtime environments (our libpng/libjpeg dll against msvcrt and our digikam binaries against msvcr80) and each of those runtimes has a different idea of what a FILE pointer is. When trying to actually do something with your FILE pointer, you will get the crash.

The solution to the png problem I found in a french forum, I did what they said and now it works (diff). The solution to the jpeg problem is a bit harder as it requires some rewrite/addition. You might have to replace my QByteArray with whatever you use to store the complete file content but essentially it is everywhere the same (changes): I got it from here.

1 comment:

Anonymous said...

I like to earn rappelz rupees, because it is very interesting. I think if you meet the rappelz gold, you will like it too. And when you play the game well you can get some cheap rappelz rupees as the rewards from the game. As long as you have a lot of rappelz money in the game you will be strong, and you can go to buy rupees with the other players.