title: How can I fix all these undefineds in SDL2main.lib?
body: <p>Trying to configure SDL2 with VS Code (BTW someone should make a Youtube video on how to do this it's taken me a week and a half so far) and I thought I was almost done when these lovely errors popped up:</p>
  
  <pre><code>C:/MinGW/bin/SDL2main.lib(Win32/Release/SDL_windows_main.obj):(.text[_OutOfMemory]+0xf): undefined reference to `SDL_ShowSimpleMessageBox'
  C:/MinGW/bin/SDL2main.lib(Win32/Release/SDL_windows_main.obj):(.text[_main_utf8]+0x4): undefined reference to `SDL_SetMainReady'
  C:/MinGW/bin/SDL2main.lib(Win32/Release/SDL_windows_main.obj):(.text[_main_getcmdline]+0xc): undefined reference to `SDL_wcslen'
  C:/MinGW/bin/SDL2main.lib(Win32/Release/SDL_windows_main.obj):(.text[_main_getcmdline]+0x21): undefined reference to `SDL_iconv_string'
  C:/MinGW/bin/SDL2main.lib(Win32/Release/SDL_windows_main.obj):(.text[_main_getcmdline]+0x3c): undefined reference to `SDL_ShowSimpleMessageBox'
  C:/MinGW/bin/SDL2main.lib(Win32/Release/SDL_windows_main.obj):(.text[_main_getcmdline]+0xb8): undefined reference to `SDL_malloc'
  C:/MinGW/bin/SDL2main.lib(Win32/Release/SDL_windows_main.obj):(.text[_main_getcmdline]+0xd3): undefined reference to `SDL_ShowSimpleMessageBox'
  C:/MinGW/bin/SDL2main.lib(Win32/Release/SDL_windows_main.obj):(.text[_main_getcmdline]+0xe9): undefined reference to `SDL_SetMainReady'
  C:/MinGW/bin/SDL2main.lib(Win32/Release/SDL_windows_main.obj):(.text[_main_getcmdline]+0xf8): undefined reference to `SDL_free'
  C:/MinGW/bin/SDL2main.lib(Win32/Release/SDL_windows_main.obj):(.text[_main_getcmdline]+0xfe): undefined reference to `SDL_free'
  C:/MinGW/bin/SDL2main.lib(Win32/Release/SDL_windows_main.obj):(.text[_wmain]+0x13): undefined reference to `SDL_malloc'
  C:/MinGW/bin/SDL2main.lib(Win32/Release/SDL_windows_main.obj):(.text[_wmain]+0x2c): undefined reference to `SDL_wcslen'
  C:/MinGW/bin/SDL2main.lib(Win32/Release/SDL_windows_main.obj):(.text[_wmain]+0x43): undefined reference to `SDL_iconv_string'
  C:/MinGW/bin/SDL2main.lib(Win32/Release/SDL_windows_main.obj):(.text[_wmain]+0x61): undefined reference to `SDL_SetMainReady'
  C:/MinGW/bin/SDL2main.lib(Win32/Release/SDL_windows_main.obj):(.text[_wmain]+0x73): undefined reference to `SDL_free'
  collect2.exe: error: ld returned 1 exit status
  The terminal process terminated with exit code: 1
  </code></pre>
  
  <p>This is what my tasks.json file looks like:</p>
  
  <pre><code>{
      // See https://go.microsoft.com/fwlink/?LinkId=733558
      // for the documentation about the tasks.json format
      "version": "2.0.0",
      "tasks": [
          {
              "label": "echo",
              "type": "shell",
              "command": "g++",
              "args": [
                 "-g",
                 "-o",
                 "C:/MinGW/bin/SDL2.dll",
                 "C:/MinGW/bin/main.cpp",
                 "C:/MinGW/bin/SDL2.lib",
                 "C:/MinGW/bin/SDL2main.lib",
                 "-lmingw32",
                 "-mwindows"
              ],
              "group": {
                  "kind": "build",
                  "isDefault": true
              },
              "problemMatcher": [
                  "$gcc"
              ]
          },
      ]
  }
  </code></pre>
  
  <p>What am I doing to get all these errors? What must I fix about SDL2main.lib? An answer would make me very happy :)</p>