We our going to start a new project in our small team:
- It’s a library which will be used by our other projects (in Linux and Windows).
- It’s not platform dependent logically (it’s not using any system calls or anything like that).
- It has to be compiled on various platforms (including Windows and Linux at least).
Unfortunately, non of our developers ever wrote any code in any other platform than Windows!
Therefore, I have to give them a “code like this” or “not code like this” list, so the code will stay cross platform.
any guidance?
One way of increasing portability is to use the same compiler, GCC, on both platforms. If you also use the same compiler version, you will probably avoid most, if not all C++ language and Standard Library incompatibilities. You can also use the same build tools, such as GNU make, which means the build process is the same on both platforms.
As for platform incompatibilities – check that their code does not contain includes like:
unless this is done via conditional compilation.