The 2024 Wheel Reinvention Jam just concluded. See the results.

Visual Studio cannot find the source file

This one has got me stumped. I am trying to step through my render_group code in visual studio, but when I start stepping through that part of the code, this happens:



I have no idea what is causing this, so I have turn to you guys for help. I don't know what information that I need to post, so I guess I will start with the build.bat file:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
@echo off



set CommonCompilerFlags=-MTd -nologo -Gm- -GR- -EHa- -Od -Oi -WX -W4 -wd4456 -wd4244 -wd4312 -wd4201 -wd4100 -wd4189 -wd4505 -DHANDMADE_INTERNAL=1 -DHANDMADE_SLOW=1 -DHANDMADE_WIN32=1 -DAUDIO=1 -FC -Z7
set CommonLinkerFlags= -incremental:no -opt:ref user32.lib gdi32.lib winmm.lib

REM TODO - can we just build both with one exe?

IF NOT EXIST ..\..\build mkdir ..\..\build
pushd ..\..\build

REM 32-bit build
REM cl %CommonCompilerFlags% ..\Handmade_Fighter\code\win32_hitbox.cpp /link -subsystem:windows,5.1 %CommonLinkerFlags%

REM 64-bit build
del *.pdb > NUL 2> NUL
echo WAITING FOR PDB > lock.temp
cl %CommonCompilerFlags% ..\Handmade_Fighter\code\hitbox.cpp -Fmhitbox.map -LD /link -incremental:no -opt:ref -PDB:hitbox_%random%.pdb -EXPORT:GameGetSoundSamples -EXPORT:GameUpdateAndRender
del lock.temp
cl %CommonCompilerFlags% ..\Handmade_Fighter\code\win32_hitbox.cpp -Fmwin32_hitbox.map /link %CommonLinkerFlags%
popd


and the code directory:



If you need anymore info, please tell me. Thanks.
I think this is a bug introduced by Visual Studio 2015 Update 3. Assuming you've upgraded.
What happens if you change -Z7 to -Zi ?
What happens if you browse to file (click the blue link) and then continue stepping? Does it correctly show lines you are stepping?
changing to Zi did not help and clicking on "Browse and find hitbox_render_group.cpp" just print this out:

1
2
3
4
5
6
7
Locating source for 'f:\handmade_fighter\code\hitbox_render_group.cpp'. Checksum: MD5 {52 fe 94 62 b9 85 f1 1b 75 47 b 7c 11 b2 a9 51}
The file 'f:\handmade_fighter\code\hitbox_render_group.cpp' exists.
Determining whether the checksum matches for the following locations:
1: f:\handmade_fighter\code\hitbox_render_group.cpp Checksum: MD5 {52 fe 94 62 b9 85 f1 1b 75 47 b 7c 11 b2 a9 51} Checksum matches.
The debugger found source in the following locations:
1: f:\handmade_fighter\code\hitbox_render_group.cpp Checksum: MD5 {52 fe 94 62 b9 85 f1 1b 75 47 b 7c 11 b2 a9 51}
The debugger will use the source at location 1.


Also, apparently I am using visual studio 2015 community edition update 1.