i have a c2065 undeclared identifier error although i declared it

hend naged 1 Reputation point
2022-04-12T16:32:40.137+00:00

include "RegisterForm.h"

using namespace CppWinFormApp4; //name of project
.
.
.
.
.
private: System::Void button4_Click(System::Object^ sender, System::EventArgs^ e) {
RegisterForm ^ reg = gcnew RegisterForm;
reg->Show();

}
When I do that I get error c2065 saying i have an undeclared identifier

Developer technologies | C++
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 60,326 Reputation points
    2022-04-12T19:01:11.017+00:00

    Perhaps it is complaining about Show and not reg? Go to definition on RegisterForm and make sure it has a Show method that accepts no arguments. Also make sure this is the only error in your code. If there are other errors then resolve them first.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.