When I try to export the following function as a dll:
extern "C" __declspec(dllexport) void some_func() { throw std::runtime_error("test throwing exception"); }
Visual C ++ 2008 gives me the following warning:
1>.\SampleTrainer.cpp(11) : warning C4297: 'some_func' : function assumed not to throw an exception but does 1> The function is extern "C" and /EHc was specified
I need extern "C" because I use Qt QLibrary to load the DLL and resolve the function name. Without extern "C" it cannot find the some_func () function.
source share