如何在 mingw 的 gcc 中启用 iconv 支持?
我尝试使用 mingw 的 gcc 和 -fexec-charset 选项来指定一些不同于 UTF-8 的编码,但出现以下错误:
Z:\>echo char foo[] = "\u00fc"; | g++ -S -xc++ -fexec-charset=latin1 -
cc1plus.exe: error: no iconv implementation, cannot convert from UTF-8 to latin1
How can I check if mingw's gcc has support for iconv and how can I enable this support in case它已关闭?
我发现错误编号 2832453 (由 Alexandr Zamaraev 提交)在 sourceforge.net 上的 mingw bugtracker 上,关于 -finput-charset
和 -fexec-charset
选项在 4.4.0 版本的 mingw 中不起作用(这就是我正在用)。 Alexandr 还在 MinGW 用户邮件列表的帖子中描述了这个问题。该错误于 2009 年 8 月 5 日提交,此后没有发生任何事情。我不确定我是否正在观察这个错误(我什至不确定这是否是一个错误,因为没有人证实这一点)或者我的设置是否有问题。
I'm trying to use mingw's gcc with -fexec-charset option to specify some encoding different than UTF-8 and I get the following error:
Z:\>echo char foo[] = "\u00fc"; | g++ -S -xc++ -fexec-charset=latin1 -
cc1plus.exe: error: no iconv implementation, cannot convert from UTF-8 to latin1
How can I check if mingw's gcc has support for iconv and how can I enable this support in case it's turned off?
I found bug number 2832453 (filed by Alexandr Zamaraev) on mingw's bugtracker at sourceforge.net about -finput-charset
and -fexec-charset
options not working in 4.4.0 version of mingw (that's what I'm using). Alexandr also described this problem in post to MinGW-users mailing list. The bug was filed on 2009-08-05 and nothing has happend since then. I'm not sure if I'm observing this bug (I'm not even sure if it's a bug because nobody has confirmed this) or if there's something wrong with my setup.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它取决于您系统的
libiconv
。它告诉您找不到它(这不是错误)安装指南此处安装后说:
It's dependent on your system's
libiconv
. It's telling you it can't find it (it's not a bug)The install guide here says after installation:
当他们编译 GCC EXE 时,他们使用configure。配置中有一个关于ICONV的设置。有时他们设置了该项,但有时他们忘记了,这时候你需要自己重新编译GCC EXE。
When they compile the GCC EXE, they use a configure. There is a setting about ICONV in the configure. Sometime they set the item, but sometime they forgot, at that time, you need recompile the GCC EXE by yourself.