I just want to make a Windows Form in C++. After opening a template, the codeblock appears along with the designer.
Then, I just want to see if the compiler works, so I tried to compile and... it gives me these.
Build started...
1>------ Build started: Project: guessinggame, Configuration: Debug Win32 ------
1>mainWindow.cpp
1>mainWindow.obj : MSIL module encountered; incremental linking is disabled for MSIL; performing full link
1>LINK : error LNK2001: unresolved external symbol _main
1>C:\Users\Karl Steven Renevera\source\repos\guessinggame\Debug\guessinggame.exe : fatal error LNK1120: 1 unresolved externals
1>Done building project "guessinggame.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I haven't changed ANYTHING YET.
Project Settings are already set to
LINKER>
System>
SubSystem>
Windows(/SUBSYSTEM:WINDOWS)
and
Entry Point>
main
Here's the default code:
#pragma once
namespace guessinggame {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
public ref class mainWindow : public System::Windows::Forms::Form
{
public:
mainWindow(void)
{
InitializeComponent();
}
protected:
~mainWindow()
{
if (components)
{
delete components;
}
}
protected:
protected:
private:
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
void InitializeComponent(void)
{
this->SuspendLayout();
this->AutoScaleDimensions = System::Drawing::SizeF(8, 16);
this->AutoScaleMode =
System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(1178, 474);
this->Name = L"mainWindow";
this->Text = L"mainWindow";
this->ResumeLayout(false);
}
#pragma endregion
};
}
Please help me asap...
What I have tried:
I've already tried the FF:
re-installing VS2019
remaking the project by copy-pasting the code
tried WinForm C++ template
tried C++/clr empty template