I would like to use Visual Studio 2010
to create a C++ application
that will eventually run on Linux
Are there any compatibility/version issues that I should be aware of?
Which compiler should I use on Windows
and on Linux
?
The compiler is unimportant as long as you use standard C++ and no platform specific extensions. If you need system specific facilities (networking, filesystem...), try to use an abstraction layer such as boost.
There are lots of issues of which you need to be aware, unfortunately. The most important, as other people have pointed out, is that you use only standard C++ plus any libraries that are portable to all the platforms you're targeting. But there are lots of other things to bite you too, e.g. different line endings (Windows uses \r\n, Unix variants generally use \n), different data type sizes, etc. More generally when you're trying to keep things portable, you also need to be aware of things like endianness, byte-ordering, the way the different filesystems work, etc.
Essentially, the most important thing is to be familiar with all the systems you're targeting. Don't write it on one system and then expect to be able to compile it pain-free on another one. Instead, compile it on all the relevant systems from day one and make sure that it continues to work on all of them, all the time. I recommend looking into a cross-platform build system like CMake (http://www.cmake.org) -- it will save you a world of pain in my experience. You don't want to have to be keeping makefiles for multiple platforms in step all the time if you can help it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With