8月 162014
 

问题

写了好几天的Go程序,都没有感觉到还会用到gcc,今天突然在go build 时报如下错误:

exec: “gcc”: executable file not found in %PATH%

原因

今天想了解一下Go语言中如果做字符集转换,发现基础类库中没有这部分,但是有几个第三方的可以使用,比如: https://github.com/djimenez/iconv-go ; 这个是将C版的iconv用Go包了一下,说到这里就水落石出了,因为我引用的iconv-go是C的一个wrap;

注意: Go 可以编译出来不同平台架构下的程序,但是如果使用的C的类库是32位的,但是却试图编译成64位的程序,将会遇到如下错误:

sorry, unimplemented: 64-bit mode not compiled in

当然,有完全Go版的字符集转换类库: http://godoc.org/code.google.com/p/go-charset

 Posted by at 下午 5:15

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据