Search code examples
c++-climanaged-c++

Error in creating heap object for the managed "ref class"


I am getting a "undeclared identifier" error in creating the object for managed "ref class" in C++.

ProfileClrApp ^profiler = gcnew ProfileClrApp();

The error is

Error 4 error C2065: 'ProfileClrApp' : undeclared identifier D:\MixedModeProfiler_src\DiagProfiler\DiagProfilerConsole\DiagProfilerConsole.cpp 88 1 DiagProfilerConsole

And i am compiling the code with /clr option only in VS2012.

What could be the issue..?

-Rahul Jain


Solution

  • "undeclared identifier" means that the typename has not been introduced; that ProfileClrApp is not a type in the current scope. Have you included the correct headers?