Given this directory tree:
src/MyLibrary/MyHeader.h
src/file.cpp
file.cpp:
#include "mylibrary/myheader.h"
...
Compiling file.cpp works with VS, fails in gcc.
- What does the standard say?
- If the path is case sensitive, why is this wise?
- What’s the best practice, keep all file/folder names lowercase and thus do the same when including?
Thanks.
The case sensitivity depends on the Operating System. Windows is not case sensitive. Linux is.
EDIT:
Actually, as observed by Martin York‘s comment, the case sensitivity depends on the file system. By default Windows uses a case insensitive file system, while Linux uses a case sensitive one. For whoever is interested to know which file systems are case sensitive and which aren’t, there is a comprehensive list on Wikipedia: Comparison of file name limitations.