The LINK error is normal: when you build handmade hero there are 2 compiles, one for win32_handmade.exe and one for handmade.dll.
The game code (handmade.cpp) is compiled in a dll and as we load a copy of the dll in the game (handmade_temp.dll), the linker can overwrite handmade.dll. Then we can unload handmade_temp.dll, copy the new handmade.dll to handmade_temp.dll and load it.
The platform code (win32_handmade.cpp) can not be linked if the game (win32_handmade.exe) is running because it has to overwrite win32_handmade.exe. As gameplay code is in the dll there is no problem with that.
For the other issue, you can open a file in visual studio and set a breakpoint. At least it works for me.
A few things that might help:
- if you try to debug after live-code-editing, the symbols may not load correctly. I posted about that
here.
- check in the build folder if there is a win32_handmade.pdb and handmade_xxxxx.pdb (where xxxxx is a random number that changes each time you build). handmade_xxxxx.pdb is the debug symbols file for the handmade.cpp (the dll code).
- you may need to open the file in a "W:\" path.
- if you save the visual studio solution (.sln), the next time you debug it should restore opened files and tabs.
Hope this helps.