Does the standard say anything about limitations on functions used with extern \"C\"
? In a questions of mine that makes no sense to anyone else. It appears that
You can't have extern 'c' that isn't compatible with 'c' - that means no default parameters and no overloaded functions
I believe the answer to this question gives a good overview of the requirements on extern "c" linkage. The issue I believe you are running into is the last item:
Linkage from C++ to objects defined in other languages and to objects defined in C++ from other languages is implementation-defined and language-dependent. Only where the object layout strategies of two language implementations are similar enough can such linkage be achieved.
Since your function is returning a class it will be implementation-defined depending on the definition of that class. This explains why it works in one compiler but not another.
The C++ faq has a few relevant sections on this as well.