There are probably other things you need to do to make the above code work. Is there any reason why your main is C and plus is C++? If it was the other way round this would be fairly easy to fix. The f() name will most likely be mangled and C won't be able to find it; there is no extern "C++" in C. extern "C" is a C++ specific feature for integrating C code into a C++ program.

What is Name Mangling I hear you cry. C++ supports function overloading, e.g.
Code:
double f(double x);
int f(int x);
char f(char x);
but the linker does not. So when the compiler compiles these to object code, it has to modify these names so that the linker does not throw "duplicate symbol" errors. So the first might become f$dbl, the second f$int, the third f$ch, in a hypothetical compiler where the name mangling works that way, and when some other C++ function calls f(double) it would look for f$dbl.

The reason this is a problem when integrating C code into C++ is that C does not support function overloading and knows nothing about name mangling. So the above three declarations will cause errors, and if you remove the 2nd and 3rd leaving double f(double) then this will be compiled (by a C compiler) into a function simply named f (actually _f but don't worry about the underscore). So a C++ program won't find this, because it's looking for f$dbl. So you have to prototype f in the C++ program as:
Code:
extern "C" {
  double f(double);
}
so that the C++ compiler knows f(double) exists and IS NOT called f$dbl.

But as you've declared f() in the C++ code and want to call it in the C code, this probably won't be fixable. I don't know if you can force f not to be mangled by prototyping it in the C++ code as extern "C" - probably not.