Tim Roberts
Tim Roberts

Reputation: 75

Problems with header having the same name, but different case, as a standard header

I have a file called Time.h in a folder (src) that is included in the additional include directories/compiler include paths. Including "Time.h" is fine, but when including , Visual Studio seems to get confused and I get upwards to 100 errors before VS stops compilation in all files from filesystem to chrono saying some standard macro is undefined. No error about ambiguity. Is this because of Windows' case insensitivity? In that case, how can it be avoided other than making a dedicated directory Time/Time.h?

Upvotes: 2

Views: 659

Answers (1)

Lightness Races in Orbit
Lightness Races in Orbit

Reputation: 385194

Is this because of Windows' case insensitivity?

Yes.

In that case, how can it be avoided other than making a dedicated directory Time/Time.h?

It can't, except by using a directory, or choosing a different name for the file.

Well, technically, you can make NTFS directories case sensitive. However, this seems like a fragile and non-portable solution, and I cannot guarantee that Visual Studio itself will honour it.

Upvotes: 2

Related Questions