The main issues are
• The C++ compiler must be used to compile
main(). This allows the C++ compiler to deal with static initialization and other magical things that
main() has to do.
• The C++ compiler must be used to direct the linking process. This allows the C++ compilers to deal with templates and also to link in the C++ libraries.
• The C++ and C compilers probably need to come from the same vendor and have compatible versions. This allows them to use compatible calling conventions in the binary code they generate, ...