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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…