There is no such thing as "Straight C ++". There will always be some library functions that you call here and there in your code, and even if you are very careful, there will not be any functions that need to be called simply by the code emitted by the compiler. For example, if you have the following loop:
for( int i = 0; i < count; i++ ) array1[i] = array2[i];
The compiler will replace it with code that simply copies the memory. And if you compile for a smaller size instead of speed, it will be a function call very similar to memmove ().
In addition, you may have floating point operations for which there are no direct equivalent x86 commands; they will also be implemented using function calls. And this list goes on.
This does not mean that your platform is platform dependent, because on another platform the compiler of this plafrom will compile the same code to go with what is the C ++ runtime environment for this platform.
Fortunately, the C ++ runtime does not have to be a separate entity from your application. Check the compiler and linker options; You should be able to create one executable file that contains both. If you find that g ++ does not require a separate runtime, this is because it does this by default.
Mike nakis
source share