79375052

Date: 2025-01-21 15:54:11
Score: 0.5
Natty:
Report link

The answer turned out quite surprising, and it took an hour with a colleague to understand it: the VC++ environment is so different from any of the MinGW/GCC environments that you have to download an entirely different version of SDL2 for it! Both libraries and headers are different. VC++ is not a POSIX compliant environment, which means in practice that things one might lightly presume to be part of C++ itself, including <unistd.h> and even <strings.h>, are not present.

I had made the mistake of taking an existing folder and installation set up for Visual Studio Code and GCC, and trying to slap a Visual Studio Solution on it.

This issue might not be evident to someone who was accustomed to using a package manager. But no! You wouldn't even use the same package manager! All becomes clearer if you download SDL2 directly from its website. This partial screenshot of their list of download options highlights the one I needed.

(List of downloadable items)

This also answers other questions I was struggling with, like why SDL (gcc version) was giving me libraries with the .a extension while CMake (VC++ world) was insisting on looking for libraries with the .lib extension.

Reasons:
  • Blacklisted phrase (0.5): I need
  • Long answer (-1):
  • No code block (0.5):
  • Self-answer (0.5):
Posted by: Joymaker