0

I am fairly new to C++ and am trying to create an entry point for my project in Visual Studio 2015. However, I keep receiving an error that the "identifier " " is undefined. Here is my code:

#include "formMain.h"
#include <Windows.h>

using namespace std;

int _stdcall WinMain(HINSTANCE hInst, HINSTANCE hPInst, LPSTR lpCmdLine, int nCmdShow)
{

formMain frm;
frm.ShowDialog();


return 0;
}

The error is referring to the section "formMain frm;", where it says identifier "formMain" is undefined.

Thank you in advance

Tas
  • 7,023
  • 3
  • 36
  • 51
  • Is the declaration of formMain placed in some namespace? – Vlad from Moscow Nov 01 '15 at 12:17
  • 2
    First, terminology. This is not the machine code level entry point. It's a Microsoft specific alternative to the standard `main` startup function. The problem with undefined identifier is not related to that, but still, you would do well by changing to a standard C++ `main` startup function (with Microsoft tools you then have to change the **entry point** to `mainCRTStartup` in the linker settings). Re the problem, possibly there's a namespace. – Cheers and hth. - Alf Nov 01 '15 at 12:17
  • Thank you. I forgot to add my actual namespace {ProjectName} to the namespace above. – Michael Gage Nov 01 '15 at 12:20

0 Answers0