Saving JPG, GIF, or PNG

I need to be able to save an Image as a JPG, GIF or PNG, but every time I
try any of these formats I get an error. JPG give a memory fault, GIF
writes and empty image, and PNG won’t even compile. The app works fine if I
save the image as a BMP. I’m Using QNX 6.0 and I have the libphexlib.so.1
from Patch B. This is the only lib from Patch B I have installed. I really
need to stay in the 6.0 realm. Anybody know what I can do to get this to
work.

Thanks
Ben