Make sure you have the proper definition of LITTLE_ENDIAN or BIG_ENDIAN. I've run into lots of other software that doesn't work on Linux without minor tweaks, because the code is unable to correctly determine the byte order without help...