doubomudichen0832 2014-03-23 21:39
浏览 41
已采纳

在Windows计算机上运行IDE,但在Linux计算机上测试/运行应用程序?

I'm doing my first steps with Go.

My workstation is on Windows and I'm using JetBrains IDE for development. Usually, I have mounted network disk (via SSH) to Linux machine. This environment it is pretty comfortable for coding and debugging with interpreted languages like PHP, Javascript (for Node), Python. But it is absolutely ugly for compiled languages like Go.

To write Go code I'm using the Go plugin for IntelliJ IDEA. Is it possible to define a remote Go compiler for this plugin (will run it on remote Linux machine)?

  • 写回答

2条回答 默认 最新

  • dongzha0813 2014-03-24 04:33
    关注

    Since Go is a compiled language, this kind of development setup is not as easy as with scripting languages. To compile a Linux binary under Windows, you have to set up a cross compilation environment. The binary packages you can download from golang.org only support the platforms they run on (i.e. the Windows compiler only produces Windows binaries), so you'll have to compile Go from source. This blog post gives a good introduction to cross compiling - make sure to also read the "caveats" section, just in case these apply to your situation. After building Go as described in the article, you will have "clones" of the "go" tool named "go-linux-amd64" ("go-[os]-[architecture]") which you can use to compile binaries for other platforms.

    Edit: Dave Cheney has written another blog post on the much improved cross compilation available in Go 1.5 (which is due in August).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办