Search code examples
visual-studiopath-separator

How to change the default path separator in Visual Studio?


I have cross-platform projects, which I have to compile with GCC, Clang and MSVC. Whenever I use the Visual Studio's and type #include <foo..., IntelliSense suggests \ as the path separator. This obviously works on MSVC, but on GCC and other compilers triggers an error.

Is there a way to tell Visual Studio to use / instead?


Solution

  • This can be done as follows:

    1. Go to "Tools → Options… → Text Editor → C/C++ → Advanced"
    2. Toggle "Use Forward Slash in #include Auto Complete" under the "IntelliSense" section