Re: Porting Between Linux and Windows



Eric Tavenner <estavenner gmail com> writes:
My goal is to be able to write code for the same app in either Linux
or Windows, and compile for both from the same code.  Is this
possible?

Sure.  I'm project admin for a program (Xiphos) which has a single code
base and builds under several flavors of Linux, BSD, and Win32.  We use
MinGW tools under Ubuntu to do the build, then transfer the result to
Windows for testing.  We cross-build the Win32 installer.

As also mentioned, your build system will be as big a problem as
anything.  We use waf these days, which has a few nightmares all its
own, but it generalizes past what we formerly had in autotools pretty
well.  The biggest hurdle we've had is getting waf's auto config to
discover localization and related things, and we've resorted to a Big
Ugly Hack to convince our config.h to show the right things for Win32.

Also be aware that anything to do with the filesystem in Windows will
cause you grief unless you use glib's wrapper functions (g_chdir,
g_setenv, g_access, ...) by which to insulate yourself from the oddities
of UTF-16 pathnames.

--karl



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]