Search code examples
c++visual-studiouser-interfacelinkerentry-point

Error LNK2019 unresolved external symbol main referenced in function "int __cdecl __scrt_common_main_seh(void)" (?__scrt_common_main_seh@@YAHXZ)


I am trying to create a new GUI project in visual studio community 2017 using the following video : https://www.youtube.com/watch?v=QCnyqMWPkQk

When I run the program for the first time I got the entry point error. I solved it by setting the sub system in the linker to Console (/SUBSYSTEM:CONSOLE).

However, after running the code again I got that error "LNK2019". Is the problem related to the entry point as well?

what should I do to solve this error ?


Solution

  • I solved my problem by the following:

    1) closing the project and restarting the PC

    2) Creating a new project and following this thread http://www.bogotobogo.com/cplusplus/application_visual_studio_2013.php