duanbu4962 2017-10-30 02:08
浏览 208

如何在cgo中正确使用64位TDM-GCC? [重复]

This question already has an answer here:

I'm attempting to use a library at github.com/hajimehoshi/ebiten. Regardless of what I do, I'm met with this error:

# github.com/go-gl/glfw/v3.2/glfw
cc1.exe: sorry, unimplemented: 64-bit mode not compiled in
# github.com/go-gl/gl/v2.1/gl
cc1.exe: sorry, unimplemented: 64-bit mode not compiled in

I've attempted updating MinGW

mingw-get udpate

I've set the PATH variable for MinGW.

I've downloaded MinGW-w64 here.

I've gone here and downloaded the tdm-gcc 64 bundle.

And still, I'm met with the same error. How do I circumvent this?

</div>
  • 写回答

1条回答 默认 最新

  • doutouhe5343 2017-10-30 06:57
    关注
    1. RTFM cgo manual, notice there how the go tool calls the compilers for the foreign languages it supports.

    2. Run

      go env
      

      and see at the variables CC and CXX it'll show you: that are the C and C++ compilers the go toolchain would call to compile C and C++ code, respectively.

      I bet it will show "bare" names such as gcc and g++, respectively.

      Notice that when a program on Windows is being run without specifying its full pathname (that is, beginning with a drive letter and followed by that :\ fun construct and then the rest of the path— ending in the actual program file's name), the program's file is looked up in a set of paths defined by the contents of the so-called environment variable called "PATH".

      That PATH env. variable can be system-wide and per-user; the latter trumps the former.

    3. In a shell, run

      echo %PATH%
      

      and see whether there are listed any pathnames of the installed C/C++ compilers. I bet there will be a path of some 32-bit GCC but not your 64-bit suite.

    4. Make sure your PATH env. variable contains an entry for the directory containing the executable program of your 64-bit compiler whose name matches the appropriate name listed in the go env output.

      Please refer to the installation manual of your compiler for more details.

    If all else fails, please ask a concrete question about installing that compiler over there at the https://superuser.com.

    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料