Errors when compiling

Hi,

Since yesterday, when I build my program, I get some errors. They even occur with a simple piece of code like this:

1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>
#include <Windows.h>


int WINAPI _tWinMAin()
{




	return 0;
}



These are the errors I get:


1
2
3
4
1
1>MSVCRTD.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)
1>c:\users\tacitus\documents\visual studio 2017\Projects\Win32Project15\Debug\Win32Project15.exe : fatal error LNK1120: 1 unresolved externals
1>Done building project "Win32Project15.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Can someone help out please? Thanks.

Regards,

Ben
C++ is case-sensitive. The function should be WinMain. not WinMAin.
The signature of your function looks strange. Normal is:
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevIns, LPSTR lpszArgument, int iShow)
What compiler IDE do you use?
Hi,

Thanks, that solved it.

I am using Visual Studio 2017
Those kind of errors better be detected quickly as they can cause serious problems later. Sometimes it can get a little harder but don't loose focus. If you find it a problem for you, you can always use some code security program. I have heard of called checkmarx. Not sure of their cost but sounds nice.
Anyway. good luck!
Ben.
Topic archived. No new replies allowed.