簡體   English   中英

任何想法如何解決此cygwin Go構建錯誤

[英]Any Ideas how to solve this cygwin Go build error

我正在用cygwin構建Windows的go程序。 我在任何地方都找不到解決此問題的方法。 任何幫助都是有用的。

C:\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
/usr/lib/w32api/libntdll.a(dmsqs01966.o):(.text+0x0): multiple definition of `pow'
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../lib/libm.a(t-d000990.o):fake:(.text+0x0): first defined here
/usr/lib/w32api/libntdll.a(dmsqs01956.o):(.text+0x0): multiple definition of `log'
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../lib/libm.a(t-d000824.o):fake:(.text+0x0): first defined here
/usr/lib/w32api/libntdll.a(dmsqs01934.o):(.text+0x0): multiple definition of `ceil'
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../lib/libm.a(t-d000253.o):fake:(.text+0x0): first defined here
C:\cygwin64\tmp\go-link-845985599/000001.o: In function `x_cgo_sys_thread_create':
C:/workdir/go/src/runtime/cgo/gcc_libinit_windows.c:12: undefined reference to `__imp___iob_func'
C:/workdir/go/src/runtime/cgo/gcc_libinit_windows.c:12:(.text+0x6): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp___iob_func'
C:\cygwin64\tmp\go-link-845985599/000001.o: In function `x_cgo_thread_start':
C:/workdir/go/src/runtime/cgo/gcc_util.c:43: undefined reference to `__imp___iob_func'
C:/workdir/go/src/runtime/cgo/gcc_util.c:43:(.text+0xdc): relocation truncated 

編輯1:有人建議使用1.8,但另一個錯誤消息

C:\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\cygwin64\tmp\go-link-485496143\000001.o: In function `_cgo_preinit_init':
C:/workdir/go/src/runtime/cgo/gcc_libinit_windows.c:28: undefined reference to `__imp___iob_func'
C:/workdir/go/src/runtime/cgo/gcc_libinit_windows.c:28:(.text+0x6a): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp___iob_func'
C:\cygwin64\tmp\go-link-485496143\000001.o: In function `x_cgo_sys_thread_create':
C:/workdir/go/src/runtime/cgo/gcc_libinit_windows.c:56: undefined reference to `__imp__beginthread'
C:/workdir/go/src/runtime/cgo/gcc_libinit_windows.c:56:(.text+0x10c): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp__beginthread'
C:/workdir/go/src/runtime/cgo/gcc_libinit_windows.c:58: undefined reference to `__imp__errno'
C:/workdir/go/src/runtime/cgo/gcc_libinit_windows.c:58:(.text+0x11e): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp__errno'
C:/workdir/go/src/runtime/cgo/gcc_libinit_windows.c:58: undefined reference to `__imp___iob_func'
C:/workdir/go/src/runtime/cgo/gcc_libinit_windows.c:58:(.text+0x126): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp___iob_func'
C:\cygwin64\tmp\go-link-485496143\000001.o: In function `x_cgo_notify_runtime_init_done':
C:/workdir/go/src/runtime/cgo/gcc_libinit_windows.c:99: undefined reference to `__imp___iob_func'
C:/workdir/go/src/runtime/cgo/gcc_libinit_windows.c:99:(.text+0x255): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp___iob_func'
C:\cygwin64\tmp\go-link-485496143\000001.o: In function `x_cgo_thread_start':
C:/workdir/go/src/runtime/cgo/gcc_util.c:18: undefined reference to `__imp___iob_func'
C:/workdir/go/src/runtime/cgo/gcc_util.c:18:(.text+0x32c): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp___iob_func'
C:\cygwin64\tmp\go-link-485496143\000001.o: In function `_cgo_sys_thread_start':
C:/workdir/go/src/runtime/cgo/gcc_windows_amd64.c:32: undefined reference to `__imp__beginthread'
C:/workdir/go/src/runtime/cgo/gcc_windows_amd64.c:32:(.text+0x403): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp__beginthread'
C:/workdir/go/src/runtime/cgo/gcc_windows_amd64.c:34: undefined reference to `__imp__errno'
C:/workdir/go/src/runtime/cgo/gcc_windows_amd64.c:34:(.text+0x415): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp__errno'
C:/workdir/go/src/runtime/cgo/gcc_windows_amd64.c:34: undefined reference to `__imp___iob_func'
C:/workdir/go/src/runtime/cgo/gcc_windows_amd64.c:34:(.text+0x41d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp___iob_func'
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../lib/libmingwex.a(lib64_libmingwex_a-ftruncate.o):ftruncate.c:(.text+0x1): undefined reference to `_chsize'
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../lib/libmingwex.a(lib64_libmingwex_a-ftruncate.o):ftruncate.c:(.text+0x1): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_chsize'
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../lib/libmingwex.a(lib64_libmingwex_a-_fstat.o):_fstat.c:(.text+0xf): undefined reference to `_fstat64'
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../lib/libmingwex.a(lib64_libmingwex_a-_fstat.o):_fstat.c:(.text+0xf): additional relocation overflows omitted from the output
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../lib/libmingwex.a(lib64_libmingwex_a-log.o):log.c:(.text+0x83): undefined reference to `_errno'
/usr/lib/gcc/x86_64-pc-

我們必須刪除cygwin並安裝此編譯器http://tdm-gcc.tdragon.net/download ,並且沒有問題。

切記從您的PATH中刪除cygwin gcc編譯器

希望對您有幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM