douzhun4124 2017-06-17 13:19
浏览 290

任何想法如何解决此cygwin Go构建错误

I am building a go program for windows with cygwin. I cannot find a solution to this problem any where. any help would be useful.

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 

EDIT 1: Someone sugested using 1.8 but another error msg

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-
  • 写回答

1条回答 默认 最新

  • dousuiguang9328 2018-04-04 05:39
    关注

    We had to remove cygwin and install this compiler http://tdm-gcc.tdragon.net/download , and we had no problems.

    Remember to remove the cygwin gcc compiler from your PATH

    I hope it'll help you.

    评论

报告相同问题?

悬赏问题

  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思