Interesting but unfortunately following these instructions is not possible. Somewhere in the middle, at the topic of "C++ startup code" it says "Locate the C startup code in the project: The easiest approach is to rename it to a C++ file with .cpp extension: " and then it suggest to make certain changes to that file. In my case with KW41Z the C generated example project has startup_MKW41Z4.S startup file. It is written in assembler. Impossible to make the suggested changes and that is one of the important things.
Meanwhile I run into other issues with C++ projects. I was experimenting a lot.
1. If I simply create a C++ project and then try to use InstallIRQHandler from fsl_common which is basically added to the project by default and I even cannot untick it, it fails with linker errors like those:
undefined reference to `__RAM_VECTOR_TABLE_SIZE_BYTES'
I learned that those symbols (like __RAM_VECTOR_TABLE_SIZE_BYTES) are supposed to be declared in the linker script file but by default C++ sets automatic linker script managing and as a result the symbols are missing and there is no example how to add what is necessary for the automatically added source code to the linker script. Apparently a custom linker script is generated with C projects and everything compiles in that case.
2. It looks like I run into another situation with the wrong order of linking obj files. I have a bunch of "undefined reference to" for the symbols which definitely exist in other obj files. I checked the methods signatures. Everything looks fine so I tend to believe the problem is the wrong linking order and I don't know how to resolve that. I hope this issue might automatically resolve if I resolve point 1 but I don't know how to do that.
All that is besides I still don't know how to port C to C++ and trying other approaches such as generating a basic C++ and then copy everything from C. That is much more tedious and does not work yet anyway.