传递链接器时调试:快速链接到Visual Studio的链接器(版本14.11.25547 - VS 2017更新15.5)当我尝试在VS调试器中运行时,我的程序执行总是会有5-7秒的延迟。我假设调试:fastlink选项是问题,因为当我删除它,一切正常。此外,如果我尝试选项debug:full,则不会发生任何更改。看来为了让VS调试器达到我的断点,链接器需要传递其中一个选项。还有其他人有这个问题吗?这有什么锻炼/解决方案吗?以防万一这是我的build.bat文件:
@echo off
set CompilerFlags= -DHANDMADE_SLOW_BUILD=1 -DHANDMADE_DEVELOPER_BUILD=1 -MT -Gm- -Z7 -nologo -Oi -Od -WX -W3 -GR -EHa-
set IncludePaths="w:\handmade\third party\sdl\include"
set LibraryPaths=/LIBPATH:"w:\handmade\third party\sdl\lib\x64"
set Libraries="SDL2.lib" "SDL2main.lib"
REM debug:fastlink/full options seem to slow the initial runtime of the app when trying to run in the debugger.
set LinkerFlags=-subsystem:CONSOLE -machine:x64 -incremental:no -nologo debug:fastlink -opt:ref
IF NOT EXIST build mkdir build
pushd build
REM 32-bit build
REM cl %CommonCompilerFlags% ..\handmade\code\win32_handmade.cpp /link -subsystem:windows,5.1 %CommonLinkerFlags%
REM 64-bit build
cl /c %CompilerFlags% -I %IncludePaths% w:\handmade\source\win32_handmade.cpp
link %LinkerFlags% -out:win32_handmade.exe ../build/win32_handmade.obj %Libraries% %LibraryPaths%
copy /y "w:\handmade\third party\sdl\lib\x64\SDL2.dll" "w:\handmade\build"
popd