Search code examples
c++visual-studiosdl

lib error in visual studio, most likely cause _ATL_MIN_CRT


I am trying to compile a program that uses SDL in Visual Studio Community 2019. I keep getting the error LIBCMTD.lib(exe_main.obj): error LNK2019: unresolved external symbol main referenced in function "int _cdecl invokemain(void)" (?invokemain@@YAHXZ). I looked online for this error and found out that the most likely cause of this error is _ATL_MIN_CRT. Does anyone know if there is another cause for this error and if not, how do I remove _ATL_MIN_CRT?


Solution

  • Make sure both SDL2.lib AND SDL2main.lib are included included. Then include shell32.lib. After that add int argc, char* argv[] to the main function.