0

This is probably me being stupid but what am I doing wrong here? I'm not sure if I need the code but I'm doing this in Visual Studio 2019.

Jowy47
  • 13
  • 2
  • Related: [https://stackoverflow.com/questions/53376811/linker-error-sdl-main-unresolved-in-main-getcmdline](https://stackoverflow.com/questions/53376811/linker-error-sdl-main-unresolved-in-main-getcmdline) – drescherjm Jun 16 '21 at 00:59
  • 1
    Does this answer your question? [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – zurgeg Jun 16 '21 at 01:27
  • 1
    See [this](https://stackoverflow.com/questions/64396979/how-do-i-use-sdl2-in-my-programs-correctly/64396980#64396980). That answer is for MinGW (not Visual Studio), but the same general principles apply. – HolyBlackCat Jun 16 '21 at 05:43

2 Answers2

0

Did you make sure that your project is linked with SDL2.lib and SDL2main.lib?

Nhalrath
  • 26
  • 4
0

Are you sure you specified both assembly versions correctly in the linker? This means both for release and for debug.

Considering that you are using VisualStudio2019, I strongly advise you to use vcpkg - this is a package management made by Microsoft that simplifies the installation of libraries and other features in 1 line =)

Using it, you do not even need to enter the linker, and the official vcpkg website will help you configure it correctly.