Consider this in a cpp file:
struct someStruct{
public:
extern "C" __declspec(dllexport) int sumup();
} someStruct;
extern "C" __declspec(dllexport) int someStruct::sumup()
{
return 0;
}
This does not compile: error: expected unqualified-id before string constant
Is it no possible to export a C++ member method with C linkage?
No. It doesn't work that way. It doesn't work at all. Can't do it. No way no how.
First off, linkage specifications don't apply to member functions; by [dcl.link]/4:
But there's even an example in the Standard that relates to your question somewhat, in the same paragraph: