Search code examples
c++visual-c++visual-studio-2019debug-symbols

Relative path for __FILE__ and PDB


I want to hide machine specific path part from executable.

Is it possible to force relative path for PDB symbols and __FILE__ macro?

So that some/all initial parts of path are not put into file?

I use MSVC, GCC solutions will not work.

All options are following:

/permissive- /MP /GS /Zc:rvalueCast /analyze- /W3 /Zc:wchar_t /I"
<some path here>" /Qspectre-load /ZI /Gm- /Od /sdl /Fd"<some path here>"
/Zc:inline /fp:precise /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D
"_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /RTC1
/GR- /Gd /Oy- /MTd /openmp- /Fa"<some path here>" /EHa /nologo
/Fo"<some path here>" /Fp"<some path here>" /diagnostics:classic

Solution

  • Compile your program without /FC and /ZI options.