A few suggestions from my practical experience:
1) Make sure to regularly compile sources on your target platforms. Do not wait until the end. This will help to quickly find errors. Use a continuous assembly system - it makes life easier.
2) Never use platform specific headers. Even for writing your own code - for everyone you know, some things in the Windows header can expect some line that was ABC in XP, but was changed to ABC.12 in Win7.
3) Use ideas from STL and BOOST, and then build on top of them. Never consider them as a panacea for problems, although STL is easy to send with code, but BOOST is not.
4) Do not use compiler-specific constructs such as __STDCALL. It asks for hell.
5) The same code when compiling with similar compiler options in g ++ and cl can lead to behavior. Please attach a copy of your compiler guide very conveniently.
Fanatic23
source share