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 QT C++ 鼠标键盘通信
  • ¥15 改进Yolov8时添加的注意力模块在task.py里检测不到
  • ¥50 高维数据处理方法求指导
  • ¥100 数字取证课程 关于FAT文件系统的操作
  • ¥15 如何使用js实现打印时每页设置统一的标题
  • ¥15 安装TIA PortalV15.1报错
  • ¥15 能把水桶搬到饮水机的机械设计
  • ¥15 Android Studio中如何把H5逻辑放在Assets 文件夹中以实现将h5代码打包为apk
  • ¥15 使用小程序wx.createWebAudioContext()开发节拍器
  • ¥15 关于#爬虫#的问题:请问HMDB代谢物爬虫的那个工具可以提供一下吗