There are many problems that you need to know about, unfortunately. The most important thing, as other people have noted, is that you use only standard C ++ plus any libraries that are portable to all the platforms you are targeting. But there are many other things to bite you, for example. different versions of strings (Windows uses \ r \ n, Unix variants usually use \ n), different data types, etc. In general, when you try to keep things portable, you also need to know about things like endianness, byte ordering, how various file systems work, etc.
In fact, the most important thing is to get acquainted with all the systems that you are aiming at. Do not write it on one system, and then expect that you can compile it without pain on another. Instead, compile it on all relevant systems from day one and make sure that it continues to work on all of them all the time. I recommend exploring a cross-platform build system such as CMake ( http://www.cmake.org ) - this will save you the pain in my experience. You donβt want makefiles running on multiple platforms all the time if you can help.
source share