Hi,
For instance: undefined reference to 'GetDeviceCaps@8'.
You need to link against all the needed libraries (gdi32 for GetDeviceCaps).
Go to Project->Build Options->Linker settings->Link libraries
Be sure to have some basic link libraries added, here. e.g. libkernel32.a, libuser32.a, libgdi32.a, libcomctl32.a
If you are getting more "undefined references", search google (or msdn directly) for the function name.
You will then find the name of the required library easily (you maybe will have to modify it slightly to fit mingw library names: see MinGW\lib directory).
If it helps, I'm trying to convert an all-C program into C++. The code still compiles with no problems if it's done in a .c file.
If your files are called .c, gcc will indeed compile them as c-files.
Anyway, most of your c-code shouldn't need any changes to be compiled with the c++ compiler.
And what is that '@8' thrown in at the end? That is not the name of the function. Is that some sort of name mangling thing?
That's the ordinal value associated with the GetDeviceCaps function. It is identifying the function in the library.
e.g. if you want to get a pointer to a function in a dll under windows call GetProcAddress with either the function name or the ordinal value as param.
Regards
raph