Gotchas in Win / Linux SDL cross-development?

Hi guys

Anybody got a URL to good “gotcha list” or howto specifically for developing
of SDL apps in Linux for the Windows SDL target using Mingw as the Windows
compiler?

I just ran into a little problem (not SDL related) regarding Mingw 's stdio
functions that don’t perform in Windows like they do in Linux (fwrite/fread
refuses to read the same amount of bytes in Windows than they do in Linux.)

So I am looking for any pointers that will address these types of problems in
cross-developing to Windows from Linux, and any SDL related cross-development
info as well.

Thanks!–
Stefan Viljoen
Polar Design Solutions
Software Support Technician

Anybody got a URL to good “gotcha list” or howto specifically for
developing of SDL apps in Linux for the Windows SDL target using Mingw as
the Windows compiler?

I know of no “gotcha list”, but I could send you a sample makefile that
compiles for either Linux or Windows.

I just ran into a little problem (not SDL related) regarding Mingw 's stdio
functions that don’t perform in Windows like they do in Linux (fwrite/fread
refuses to read the same amount of bytes in Windows than they do in Linux.)

This is a Windows bug (or feature, depending on your point of view). You have
to work around it in your code. It’s due to Windows’ improper (IMO) handling
of newlines in text files.

JeffOn Saturday 27 March 2004 02:01 am, Stefan Viljoen wrote:

Stefan Viljoen wrote:

Hi guys

Anybody got a URL to good “gotcha list” or howto specifically for developing
of SDL apps in Linux for the Windows SDL target using Mingw as the Windows
compiler?

I just ran into a little problem (not SDL related) regarding Mingw 's stdio
functions that don’t perform in Windows like they do in Linux (fwrite/fread
refuses to read the same amount of bytes in Windows than they do in Linux.)

Did you add the ‘b’ mode in fopen ? For example :
fopen(“file.dat”,“rb”);
and not :
fopen(“file.dat”,“r”);

This ‘b’ mode is safely ignored on any non-windows platform, and makes
the fread/fwrites behave like the “standard” unix functions. So this
mode should be set all the time, IMO. At least that’s what I do.

Stephane

Hi guys

Anybody got a URL to good “gotcha list” or howto specifically for developing
of SDL apps in Linux for the Windows SDL target using Mingw as the Windows
compiler?

I just ran into a little problem (not SDL related) regarding Mingw 's stdio
functions that don’t perform in Windows like they do in Linux (fwrite/fread
refuses to read the same amount of bytes in Windows than they do in Linux.)

So I am looking for any pointers that will address these types of problems in
cross-developing to Windows from Linux, and any SDL related cross-development
info as well.

Thanks!On our mpeg4ip package, I have developed a file called mpeg4ip.h (in our include file) that has 3 years of defines for porting between windows and linux. Take a look. One thing you have to worry about for windows (and mac osx, it seems) is that the video and events need to be processed in the main thread - this is not true of linux. Bill May http://www.mpeg4ip.net Stefan Viljoen wrote:

Stephane Marchesin wrote:

This ‘b’ mode is safely ignored on any non-windows platform, and makes
the fread/fwrites behave like the “standard” unix functions.

Actually ‘b’ is required on a number of non-Windows platforms, such as
MacOS.

So this
mode should be set all the time, IMO. At least that’s what I do.

‘b’ should always be used unless you want to translate between native line
endings and “standard” ‘\n’ line endings in text files.–
Rainer Deyke - rainerd at eldwood.com - http://eldwood.com