I am developing an application that will have to run on both Windows and Linux.
So far I have it running on Linux using GCC 4.4.1 using my Makefile.
However, I also need to compile on Windows. The source code will compile on Windows as I have #defined all the areas of the code that separate the different compilers. I.e.:
#ifdefined (LINUX)
/* Do linux stuff */
#else
/* Do windows stuff */
#endif
And so far the code is very simple as I am just starting this program. Basically I just want to test my idea.
However, is it as simple as compiling the source code on Linux?
Then when I want to compile on to Windows I could copy the files to the Windows platform. Then opening the source code files in Visual Studio C++ and creating a project and then compiling to create my binary?
Using Visual C++ is one way of building your C project on Windows. It’s not the only way, though.
VC has project files that you will need to create. But then realize that you’ll have to maintain the build configuration in two different places (make & .vcproj).
There are other options as well:
If I were you I’d try to use as few different build tools as possible.