douhuang2218 2014-03-20 15:42
浏览 259

交叉编译在Windows 64(TDM-GCC-64)上转到.linux文件,但是尽管GOOS = linux,仍继续编译到.exe文件

I am attempting to compile a .go source file to a .linux file. I'm using TDM-GCC-64 on Windows 7 64-bit.

I have set my GOOS to 'linux'. I've also set GOARCH to amd64.

I then rebuild Go in C:\Go\src using make.bat. This all runs successfully.

The compilation runs successfully but each time it compiles a Windows .exe despite the system variables set.

My question is how to overcome this issue - what am I doing wrong?

Edit: I had MinGW installed before TDM-GCC, which did not work.

  • 写回答

1条回答 默认 最新

  • dtkz3186 2014-03-21 04:15
    关注

    You can test to see if those values are exporting using echo like this:echo %GOOS%

    If you modify the system variables without restarting your console it won't have the new values. You should try exporting via the command line using set GOOS="linux" and set GOARCH="amd64"

    If this does not fix it I would follow the guide that Kluyg posted.

    评论

报告相同问题?

悬赏问题

  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题