Non-localized version of MinGW?

2020-03-19 02:02发布

Is there a way to download MinGW with gcc, that is not localized? Localized gcc causes all warnings to become errors in CodeBlocks, if the system language is not English. This is a bug also reported here:

http://forums.codeblocks.org/index.php/topic,9489.msg67120.html

The thread also contains a working solution to the problem, but if one could download a non-localized version in the first place, this would be much more convenient.

3条回答
Bombasti
2楼-- · 2020-03-19 02:35

I'm pretty sure the following is not the "recommended solution", but I personally gave up on trying to find one. So: My locale is "da" which causes exactly the kind of problem you describe.

My solution? Simply erase the locale used, causing the system to default to english: i.e. in my case erase the folder:

C:\MinGW\share\locale\da

Why on earth anyone coding in C/C++ would want their tools to output localized error-messages is beyond me...

查看更多
我命由我不由天
3楼-- · 2020-03-19 02:52

Use the commmand

locale -a

to see a list of enabled locales. To use USA English, I set below environment variables in my bash's source file

export LANG=en_US.UTF-8
export LC_CTYPE="en_US.UTF-8"
export LC_NUMERIC="en_US.UTF-8"
export LC_TIME="en_US.UTF-8"
export LC_COLLATE="en_US.UTF-8"
export LC_MONETARY="en_US.UTF-8"
export LC_MESSAGES="en_US.UTF-8"
查看更多
兄弟一词,经得起流年.
4楼-- · 2020-03-19 02:54

Gcc & G++ in mingw use the environment variable LC_ALL to define the language at top level (if this variable is set), defaulting with the system locale if available, and then english if the locale does not exist.

If you want to force those tools to output their messages in english, just add/edit the environment variable LC_ALL with the value en_US.UTF-8

查看更多
登录 后发表回答