安装不成功
mejinke opened this issue · comments
sh-3.2# go get github.com/qiniu/iconv
github.com/qiniu/iconv
Undefined symbols for architecture x86_64:
"_libiconv", referenced from:
__cgo_6945b30ee13d_C2func_iconv in iconv.cgo2.o
__cgo_6945b30ee13d_Cfunc_iconv in iconv.cgo2.o
"_libiconv_close", referenced from:
__cgo_6945b30ee13d_C2func_iconv_close in iconv.cgo2.o
__cgo_6945b30ee13d_Cfunc_iconv_close in iconv.cgo2.o
"_libiconv_open", referenced from:
__cgo_6945b30ee13d_C2func_iconv_open in iconv.cgo2.o
__cgo_6945b30ee13d_Cfunc_iconv_open in iconv.cgo2.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
github.com/qiniu/iconv
C:\Users\ADMINI1\AppData\Local\Temp\go-build665995231\github.com\qiniu\iconv_obj\iconv.cgo2.o: In function 1\AppData\Local\Temp\go-build665995231\github.com\qiniu\iconv_obj\iconv.cgo2.o: In function cgo_74e683614c51_C2func_iconv': C:/Go/src/src/github.com/qiniu/iconv/iconv.go:47: undefined reference to
libiconv'
C:\Users\ADMINIcgo_74e683614c51_C2func_iconv_close': C:/Go/src/src/github.com/qiniu/iconv/iconv.go:62: undefined reference to
libiconv_close'
C:\Users\ADMINI1\AppData\Local\Temp\go-build665995231\github.com\qiniu\iconv_obj\iconv.cgo2.o: In function 1\AppData\Local\Temp\go-build665995231\github.com\qiniu\iconv_obj\iconv.cgo2.o: In function cgo_74e683614c51_C2func_iconv_open': C:/Go/src/src/github.com/qiniu/iconv/iconv.go:78: undefined reference to
libiconv_open'
C:\Users\ADMINIcgo_74e683614c51_Cfunc_iconv': C:/Go/src/src/github.com/qiniu/iconv/iconv.go:105: undefined reference to
libiconv'
C:\Users\ADMINI1\AppData\Local\Temp\go-build665995231\github.com\qiniu\iconv_obj\iconv.cgo2.o: In function 1\AppData\Local\Temp\go-build665995231\github.com\qiniu\iconv_obj\iconv.cgo2.o: In function cgo_74e683614c51_Cfunc_iconv_close': C:/Go/src/src/github.com/qiniu/iconv/iconv.go:118: undefined reference to
libiconv_close'
C:\Users\ADMINIcgo_74e683614c51_Cfunc_iconv_open': C:/Go/src/src/github.com/qiniu/iconv/iconv.go:132: undefined reference to
libiconv_open'
collect2.exe: error: ld returned 1 exit status
エラー: プロセスがコード 2 で終了しました
D:/jian/opt/mingw64-x86_64-4.8.5-release-posix-seh-rt_v4-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.5/../../../../x86_64-w64-mingw32/lib/../lib/libiconv.a(localcharset.o):localcharset.c:(.text+0x8): undefined reference to `__imp_GetACP'
collect2.exe: error: ld returned 1 exit status
CentOS 5.6安装不成功,错误跟大家的有点类似,查看iconv.go源码,将#cgo freebsd LDFLAGS: -liconv中freebsd改成linux,再安装就成功了,使用是也没发现有什么问题。