[C and C++] Calling C++ function from c
Hello all,
I have a c program that is doing a few things with a MySQL database and I found a piece of code written in C++ to determine the amount of CPU usage on my machine. I would like to call the function written in C++ in my C program and then write this to the database, compiling goes fine until the linker fails saying:
Linking...
net_sql.obj : error LNK2001: unresolved external symbol _GetCpuUsage
release/netsql.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Any idea why this is happening? Is there some way to do what I am trying to do?
I'm using Microsoft Visual C++ 6. The Cpu usage code is not a lib or dll, just cpp files.
|