Porting code to Windows
I’ve set myself the task of porting libtrace to Windows, so that Perry and I can use it in an upcoming project that we’ve been scheming for a long time. It’s going to be a reasonably large job I think!
For a start its going to involve relearning all the MSVC oddities that I knew back when I last wrote code for Windows (over 4 years ago) and then there is all the stupid compatibility issues between various header files and type definitions to work out.
I haven’t been able to find a good document that lists all the common problems that you run into porting a GNU library to Windows which surprised me somewhat. There are plenty of documents about how to port code from Windows to Linux however. If anyone knows of some handy resources I would love to hear about them.
Cygwin/Mingw32 etc are not suitable for this project.
Just out of curiosity, why would MinGW not work here? Note that nowadays, you can build a library with MinGW and use it with MSVC or vice versa, so even if the project you want libtrace for requires MSVC, you could still use MinGW for libtrace itself. For example, libSDL builds for Windows come from a MinGW cross-compile, even though MSVC users make use of them.
Comment by Anonymous — April 8, 2006 @ 5:33 am
The final application that we’re heading towards is intended to sit as a Windows taskbar applet.
The advice that I had received was that it would make our task much easier if we have everything in Visual Studio.
Comment by matt — April 8, 2006 @ 10:59 am
Defining WIN32_LEAN_AND_MEAN on the command line avoids a lot of hassle with incompatibilities between header versions.
Comment by Mark Brown — April 8, 2006 @ 9:00 pm
I ported gnomemeeting/ekiga on win32, using mingw on win32, then improving to be able to cross-compile from GNU/Linux for win32, again using mingw.
Use mingw.
Use autotools.
Use libtool.
Use pkg-config.
Choose your tools wisely
Comment by Snark — April 9, 2006 @ 12:26 am