views:

323

answers:

1

I've written a program which opens a bmp file and treats it as a character file and performs run length encoding on it. It produces a valid compressed encoding file, which I read again to perform the decoding.

When i'd made the application i was using Fedora and it ran perfectly fine. Now i'm running it on ubuntu and it refuses to work.

Any idea what is wrong? I fear it has to do with the encoding.

+1  A: 

I would first and foremost suggest using a source code debugger to find the problem.

Possible causes include using different compilers on the different systems, which might do different things with, for example, packing structs (e.g., BITMAPFILEHEADER). You also might have different CPU architectures on the two systems (64- vs. 32-bit).

You can also use a hex editor (e.g., XVI32) to examine the differences between BMP files generated by the two versions of your program.

rkb