doushi1929 2017-10-31 19:19
浏览 225
已采纳

在Golang IDE中运行GUI应用

When I build in Terminal, I can use a flag to say I want to build for GUI:

go build -ldflags="-H windowsgui"

However, I just started using Gogland (JetBrains) and I don't how to run GUI apps. What can I do?

  • 写回答

1条回答 默认 最新

  • dqu94359 2017-10-31 19:25
    关注

    go build will only build the application.

    To actually run the application, you should go to Run | Edit Configurations... | + | Go Application and configure the application as you need.

    Here you will need to set two options:

    • add -ldflags="-H windowsgui" to the Go tool arguments option
    • configure the Output directory to be in the same directory as your .manifest file

    Setting the output directory is critical in order to run the the application without encountering the following panic panic: TTM_ADDTOOL failed described in this issue.

    Then you can run the configuration via Run | Run... and select the configuration you've just created.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?