Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unresolved external "int __cdecl invoke_main(void)" after VS2017 15.6.1 update

I hope someone can help/guide me here. I had a working application, but today I keep getting the following error:

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

The only thing that changed was that I updated VS2017 15.5.4 to VS2017 15.6.1 (latest). I been reading here and there, and I believe somewhere some setting may have changed and now the program is failing to "see" the main function. For the record, I did try this code in my laptop which still has VS2017 15.5.4 and ran without any issues. Any idea what it may be?

like image 212
Velchivz Avatar asked Sep 06 '25 20:09

Velchivz


2 Answers

Check your project config.

Right-click the project -> Properties -> Linker -> System -> SubSystem.

You probably want that to be set to Windows (/SUBSYSTEM:WINDOWS)

like image 197
Kirill Shlenskiy Avatar answered Sep 08 '25 22:09

Kirill Shlenskiy


I couldn't find a fix to it. I had to make a new project and move everything there.

like image 26
Velchivz Avatar answered Sep 09 '25 00:09

Velchivz