Problem with freeimage

BlitzMax Forums/Brucey's Modules/Problem with freeimage

Impi(Posted 2011) [#1]
I can't use 'import bah.FreeImage'
My application is crashing as soon as I use loadpixmap etc.
It works with 'framework bah.FreeImage' though. But then I have to import all the modules manually.
Does anybody know what's the problem?


Brucey(Posted 2011) [#2]
You will have issues if you do not use a Framework of some kind, since freeimage also has versions of libjpeg and libpng in it.
Without a Framework (it doesn't matter what, but you'll need to import everything else you'll need too), you will end up with all the default BlitzMax modules, which includes ALL the image modules, sound modules, etc., plus any specific imports you do, like bah.freeimage.
The issue is that you cannot have TWO different versions of the same library loaded at the same time. This is where things are likely to start crashing :-)


Armitage 1982(Posted 2011) [#3]
Exactly.

May I point you to this thread, I give a solution at the end:
http://blitzmax.com/Community/posts.php?topic=95858


Impi(Posted 2011) [#4]
Ok thanks. This helps.


Rixarn(Posted 2011) [#5]
Your solution helped me too Armitage! Thanks a Lot

I just upgraded to V144 and had this issue. Your fix worked like a charm =)


Rixarn(Posted 2011) [#6]
I've found another problem. But it's not serious... if you call the BMax's function SavePixmapPNG you'll likely crash your app. But since you have freeimage, you can save the images with that anyway so...


Brucey(Posted 2011) [#7]
Really, you don't want to have Pub.LibPNG and FreeImage loaded at the same time...