Is there a way to make Visual Studio case sensitive on includes?

Case sensitivity doesn't depend on the compiler, but the underlying file system. So Linux may not be case sensitive, if the file system is remotely mounted on a Windows box, and vice versa. If you want to force case sensitivity on a Windows box, the only solution I know is to remote mount a file system on a Unix box.

Note that this shouldn't be a problem if you're developing on Linux, then moving to Windows. It's the reverse which is a problem. And the only real solution is to define and strictly enforce a naming convention. You need it for the code anyway (since C++ is case sensitive regardless). So if you have a class FxTrade, your coding conventions should insist that it is Fx, and not FX; these convensions must be enforced in the C++ code, or you'll go nuts having to look up each time which one it is, and the same code review that enforces them in the source should enforce them in the file names.

(And for what it's worth, it's a real pain to fix such an error under Subversion, since svn FXTrade.cpp FxTrade.cpp doesn't work under Windows; you have to move it to some other name, then commit, and then move it to the name you want.)


Since February 28, 2018 https://blogs.msdn.microsoft.com/commandline/2018/02/28/per-directory-case-sensitivity-and-wsl/ you can choose if a folder is case sensitive or not in windows.

fsutil.exe file setCaseSensitiveInfo <path> enable
fsutil.exe file setCaseSensitiveInfo <path> disable

the command does not work recursively if you want so you have to write something like that :

$directories = Get-ChildItem $path  -Recurse -Directory

ForEach($dir In $directories)
{
    fsutil.exe file setCaseSensitiveInfo $dir.FullName enable
}

One liner:

$directories = Get-ChildItem $path -Recurse -Directory ForEach($dir In $directories) { fsutil.exe file setCaseSensitiveInfo $dir.FullName enable }