f() is not defined in main.c. So the compiler assumes this is an int with no parameters, i.e. int f(); If you want something other than that then you have to prototype it (as you have done, unnecessarily, in plus.cpp).

You cannot compile C code with a C++ compiler because it is a different language. Use a C compiler. However you can integrate C code with C++ code, in the C++ code you have to declare the functions extern "C" to prevent name mangling.

C++ is a superset of C so converting C to C++ should be fairly easy. There are some significant differences though and you should read up on those before trying. It may be easier to compile the C code with a C compiler, and the C++ code with a C++ compiler, and link the resulting objects together.

Regarding the vice versa, no, obviously this is mostly impossible. C does not support all the object stuff you get in C++ and there are other major differences too. Don't even try.