I was finishing one of my earliest C++ projects which is (according to the framework) supposed to be cross-platform. I developed the project fully in Windows and Visual Studio, thinking that since the libraries are all cross-platform, then doing the OSX build "later on" would be trivial. This turned out not to be the case, but rather the "Windows code" doesn't run properly and had some compilation errors to be fixed.
What techniques exist to beforehand ensure that the code is compatible with all platforms? Developing all platforms simultaneously, thus testing the code against every platform at the same time, when new features are added, rather than develop the different platform versions one after each other?(*)
Looking specifically advise that's not dependent on the tools, but rather "development processes" that help cross-platform compatibility, regardless of what tools are used. Like the one (*) above.
Specifically I'm developing a VST plug-in with WDL-OL (https://github.com/olilarkin/wdl-ol) and some cross-platform DSP libraries. WDL-OL projects have both VS and Xcode projects set up, but I guess the problems come from the libraries and then differences in compilers.
Best Answer
Creating portable code can be very challenging.
First some obvious language related advices:
Then a couple of design recommendations:
Finally the delicate points:
TCHAR
), but this can then be challenging in combination with the standard library (e.g.cout
vswcout
to be used depending if usingchar
orwchar_t
)But these are only advices. In this area you can't gain certainty.