As there is no Win32 option in the start menu, I created an empty desktop application using the Windows Desktop Wizard (as in here)
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 | #include <windows.h> int CALLBACK WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ); void foo(void) { } |
Error:
1 2 3 4 5 6 | 1>------ Build started: Project: intro_c, Configuration: Debug Win32 ------ 1>Source.cpp 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\HP\source\repos\intro_c\Debug\intro_c.exe : fatal error LNK1120: 1 unresolved externals 1>Done building project "intro_c.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== |
Also, if I include
1 | <iostream> |
I searched every error and looked all over the internet, but couldn't find the solution.
What is the problem here ? Have I messed up during creating a new project? Please help.