Every time that I try to develop for windows (with Visual Studio), I have a hard time. And I do this so infrequently, that I tend to forget stuff too. I now try to make a windows version of Imhotep, Pyramid Builder. Here I will document some gotchas when developing under windows.
- It turns out that for 64bit builds that use libSDL2, you need to add some inputs to the linker, being: winmm.lib, Imm32.lib, version.lib libraries.
- What's up with the '32' suffix for 64 bit builds? Somehow you still need to link Imm32 and OpenGL32 and not Imm64 or OpenGL64?
- The best way to generate new project files is to copy them from an old project, and edit the XML contents.
- Don't use a full screen app and a full screen debugger at the same time. If you hit a breakpoint, the apps fight over the screen, and you cannot control the debugger any more.
- Win32 builds cannot handle functions that take four __m256 arguments. Three is fine, but for the fourth, the compiler craps out with the message "formal parameter with requested alignment of 32 won't be aligned." If my code were to be C++ I could replace with const references to __m256, but this is C code. So I have decided to not build 32bit versions of my game at all.
- To get rid of the generated .iobj and .ipdb files, change the Linker/Optimization/Link Time Code Generation option to something other than /LTCG:Incremental.
- Before creating my .exe file, Visual Studio creates a .lib and .exp by the same name. I don't know why. Configuration is set to Application(.exe) so why create the lib?