C2061 Compiler error

Hi. I got error message when I try to build my project

"d:\Documents and Settings\Phoenix\ \My_app\autonapominalka\main.cpp(164): error C2061: syntax error : identifier 'form1'"

Code sample:
//--------------------------
Form * form1 = new error;

//some code

form1->Controls->Add(listbox);// error shows on this string

form1->Show();
//-----------------------------

So, I have declaration but Visual C++ thinks that form1 is undeclarated. How can i resolve the problem

I use Visual Studio .NET 2003



Answer this question

C2061 Compiler error

  • Paul Coene

    Could you post a complete small sample code that can reproduce the issue

    Edit:
    Marking the post as correct answer. Please unmark the post once you post a sample.

    Thanks,
      Ayman Shoukry
      VC++ Team

  • C2061 Compiler error