C2601: local function definitions are illegal

Hello, Begginner coder here and ive been trying to figure out this problem to no avail. When compiling I get a C2601: 'Main' : local function definitions are illegal. Where did I go wrong. As far as ive been able to tell this error comes from bracketing errors / trying to define a function within a function. Any suggestions on what I should change?

#include "Form1.h"
#include "Edits.h"

using namespace Keepo;

void Main(void)
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
Application::Run(gcnew Form1);
Application::Exit();
}

void Form1::checkBox1_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
{
UNFJFunction(this->checkBox1->Checked);
}


error C2601: 'Main' : local function definitions are illegal
error C2061: 'Keepo::Form1::checkBox!_CheckedChanged' : local function definitions are illegal
Probably an unclosed curly brace in Edits.h.
I believe that was it. Thank you very much been trying to figure this out for a while and feel silly now.
Topic archived. No new replies allowed.