Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Compiler Warning (level 4) C4339
Collapse the table of content
Expand the table of content

Compiler Warning (level 4) C4339

Error Message

'type' : use of undefined type detected in CLR meta-data - use of this type may lead to a runtime exception

A type was not defined in code that was compiled for the common language runtime. Define the type to avoid a possible runtime exception.

This warning is off by default. See Compiler Warnings That Are Off by Default for more information.

The following sample generates C4339:

// C4339.cpp
// compile with: /W4 /clr /c
// C4339 expected
#pragma warning(default : 4339)

// Delete the following line to resolve.
class A;

// Uncomment the following line to resolve.
// class A{};


class X {
public:
   X() {}

   virtual A *mf() {
      return 0;
   }
};

X * f() {
   return new X();
}

Community Additions

ADD
Show:
© 2015 Microsoft