Go编译器有窗口设置选项吗? [英] Is there a windowed setting option for the Go compiler?

查看:237
本文介绍了Go编译器有窗口设置选项吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Go(6g)编译一个GTK应用程序,我想知道是否有一个编译器/链接器选项,使其成为Windows可执行文件,而不是控制台可执行文件。 MinGW有一个-mwindows选项,目前我不得不手动更改PE头用十六进制编辑器是恼人的。

I'm using Go (6g) to compile a GTK application and I want to know if there is a compiler/linker option to make it a Windows executable as opposed to console executable. MinGW has a -mwindows option for this and currently I'm having to manually alter the PE header with a hex editor which is annoying.

推荐答案


-ldflags 'flag list'传递每个5l,6l或8l链接器的参数
调用

-ldflags 'flag list' arguments to pass on each 5l, 6l, or 8l linker invocation

编译软件包和依赖项

-Hwindowsgui (只有6l / 8l)写入Windows PE32 + GUI二进制文件

-Hwindowsgui (only in 6l/8l) Write Windows PE32+ GUI binaries

指令ld

新增 -ldflags -Hwindowsgui go build / get / install 命令行。例如,

go build -ldflags="-Hwindowsgui" gtkapp.go

这篇关于Go编译器有窗口设置选项吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆