I am exporting functions from a static library as follows:
extern "C"
{
__declspec(dllexport) HRESULT CreateGraphicsDevice(HINSTANCE hDLL, IAMG3DGraphicsDevice **pInterface);
}
All my code is written in C++, so I don't see why I need to extern "C". For example, if I put:
extern __declspec(dllexport) HRESULT CreateGraphicsDevice(HINSTANCE hDLL, IAMG3DGraphicsDevice ** pInterface)
the function is not accessible from the DLL. Why is extern "C" required if my code is written in c++ as opposed to putting extern directly before the function declaration?