Windows does support the POSIX interfaces, but writing code that works equally on Windows as on Unix is not simple, especially if you want to write GUI applications. In such a case, you would be best served by using a platform neutral SDK such as Qt. That provides a means to write C++ code that will run on any number of different operating systems without recoding - just recompilation.
rubberman
Posting Maven
2,578 posts since Mar 2010
Reputation Points: 365
Solved Threads: 307
Skill Endorsements: 52
I have heard that it is possible to set up a cross-compiler environment which will allow you to build executables for other platforms from within Linux, but I've never looked into it. The few cross-platform apps I've worked on have been done as per Rubbermans post.
e.g.
Using cross-platform libraries like QT or wxWidgets, separating any platform specific (or even compiler specific) code using #ifdef statements and using the preprocessor to perform conditional compilation. Then when it came to building the apps on different target platforms, it was a case of compiling the code in the targets native environment using a supported compiler.
I think google might be your friend here.
Here are a few links I found on the topic...
About cross-compilation:
http://en.wikipedia.org/wiki/Cross_compiler#GCC_and_cross_compilation
Cross-compiling wxWidgets for Windows on Linux:
http://wiki.wxwidgets.org/Cross-Compiling_Under_Linux#Cross-compiling_under_Linux_for_MS_Windows
MinGW as a cross compiler on Linux:
http://www.mingw.org/wiki/LinuxCrossMinGW
From an initial glance it looks like it'll be a bit of a pain to set up and get working. Good luck!
JasonHippy
Practically a Posting Shark
862 posts since Jan 2009
Reputation Points: 615
Solved Threads: 146
Skill Endorsements: 5
Question Answered as of 1 Year Ago by
JasonHippy
and
rubberman Fedora has a win32 cross compiler that uses mingw and wine.
jbennet
Moderator
18,528 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 609
Skill Endorsements: 29