FAQ 36.04 Why is the linker giving errors for C functions called from C++ functions and vice versa?main() should be compiled with the C++ compiler, and the C++ compiler should direct the linking process. The C++ compiler should be used to compile main() because it normally embeds C++-specific operations inside the compiled code (for example, to deal with static initialization; see FAQ 2.10). The C++ compiler should direct the linking process since it needs to deal with things such as C++ libraries, static initialization, and templates. |