Go编译器有窗口设置选项吗?

编程入门 行业动态 更新时间:2024-10-26 19:36:52
本文介绍了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编译器有窗口设置选项吗?

本文发布于:2023-11-14 19:05:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1588279.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:编译器   选项   窗口

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!