如何使MinGW区分大小写包含头文件名 [英] How can I make MinGW case-sensitive for included header file names

查看:328
本文介绍了如何使MinGW区分大小写包含头文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让MinGW验证#include指令中指定的文件名是否正确。 MinGW默认情况下不区分大小写,可能是因为窗口在文件名方面不区分大小写,但是我在跨平台环境中工作,并且希望确保gcc不会在Linux下抱怨,当有人指定包含文件错误的情况。

I want to make MinGW validate that the file names specified in #include directives are case correct. MinGW is case insensitive by default, probably because windows is case insensitive when it comes to filenames, but I am working in a cross platform environment, and want to make sure that gcc doesn't complain under Linux when somebody specifies an include file with the wrong case.

我以为可能有一个编译开关强制这个,但没有能找到一个。欢迎任何其他建议。

I thought there might be a compile switch to force this, but haven't been able to find one. Any alternative suggestions would also be welcome.

推荐答案

我不认为MinGW有这样的选择。如果你假设你在NTFS上运行,至少,它可能不会太难以编码和贡献补丁。但最简单的解决方案是简单地提醒人们是正确的,并修复(希望罕见的)实例,他们滑上来。

I don't think MinGW has any such option. If you assume you're running on NTFS, at least, it would probably not be too difficult to code it up and contribute a patch. But the easiest solution by far is to simply remind people to be case correct, and fix the (hopefully rare!) instances where they slip up.

有时最好的解决方案是社会性,而不是技术性。

Sometimes the best solution is social, rather than technical.

这篇关于如何使MinGW区分大小写包含头文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆