This works on linux...but why not windows?

I am trying to get a game I've been working on for linux to run on windows. It is all compiling ok but when I try and read in the quake to models, fseek is failing to read all the data on the windows build.

Perhaps the structures are padded differently between the two machines - simply copying a binary file containing structures written with fwrite() from one machine to another is full of fun for all the family.

> stderr,"Error reading triangles from model file (%d).\n"
You could have at least printed the value you expected as well.
In addition, the fseek() call itself needs an "else error message" bit of code.

> is windows different or is my code bad?
Yes and Yes
Or more specifically, your assumptions of portability are probably wrong.

Perhaps the structures are padded differently between the two machines - simply copying a binary file containing structures written with fwrite() from one machine to another is full of fun for all the family.

If agree with Salem -- structure padding and alignment will often bite you in the nether regions when transitioning code between Linux and Windows.