2

We develop c++ applications using MSVC2019. Opening the exceutable in a text editor shows filenames of source files with absolute path are embedded in the exe file. How can I get rid of that filenames to hide private data from my local computer (directory structure). This happens also with Release builds.

wre
  • 21
  • 2
  • 1
    Do you include debug info? – Devolus Jan 29 '21 at 11:12
  • Linker option "Generate debug Info"=No – wre Jan 29 '21 at 11:30
  • You should also disable debug info in the compiler settings. – Devolus Jan 29 '21 at 11:44
  • I changed compiler setting "Debug Information Format" to None - no change – wre Jan 29 '21 at 12:24
  • @wre Compile without `DEBUG` or `_DEBUG` defined. Do not use `__FILE__` macros for tracing/reporting. You *can* (even *should*) build with debug info, but make sure it's in a separate `.pdb` file, and use [`/pdbaltpath`](https://learn.microsoft.com/en-us/cpp/build/reference/pdbaltpath-use-alternate-pdb-path?view=msvc-160) to strip the full `.pdb` path from the binary. If you still see source paths in the final `.exe`/`.dll` please post a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) with the necessary details. – dxiv Jan 29 '21 at 17:50

0 Answers0