开发者

How to enable iconv support in mingw's gcc?

开发者 https://www.devze.com 2023-02-16 09:14 出处:网络
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:

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 -fi开发者_运维技巧nput-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.


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:

However, you still need to copy zlib1.dll, iconv.dll & libxml2.dll to .../install_dir/bin


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号