FAQ
So I discovered recently that you can embed icons and manifests and the
like into go executables on windows using a rather arcane process of 8g,
pack, and 8l invocations. Are there any plans to add support for this to go
build? It would be really nice for people making windows programs,
especially gui ones.

The requirements are simple: when running go build on windows for
executable output and there is an .rc file in the directory corresponding
to the main package, hand it off to windres (in mingw) and add the
resulting .o file to the .a archive containing the package. That's it.

This of course would mean that mingw would be required for doing this sort
of thing, but I certainly don't have a problem with that - after all, it's
already needed for cgo.

If there's no plans, would a patch be accepted?

--

Search Discussions

  • Brainman at Oct 9, 2012 at 11:58 pm

    On Wednesday, 10 October 2012 09:39:51 UTC+11, (unknown) wrote:
    So I discovered recently that you can embed icons and manifests and the
    like into go executables on windows using a rather arcane process of 8g,
    pack, and 8l invocations. ...

    You can also rename your .o into .syso. Then go command will link them into
    your executable automatically.

    Are there any plans to add support for this to go build? ...

    None, as far as I am aware.

    The requirements are simple: when running go build on windows for
    executable output and there is an .rc file in the directory corresponding
    to the main package, hand it off to windres (in mingw) and add the
    resulting .o file to the .a archive containing the package. That's it.

    What about non-main packages?

    This of course would mean that mingw would be required for doing this sort
    of thing, but I certainly don't have a problem with that - after all, it's
    already needed for cgo.

    If there's no plans, would a patch be accepted?
    Sounds like fine plan to me, but I am not sure about other gophers.
    Perhaps, if it is simple enough, it might work.

    Alex

    --
  • Ken Allen at Oct 10, 2012 at 12:33 am

    On Tuesday, October 9, 2012 7:58:52 PM UTC-4, brainman wrote:
    You can also rename your .o into .syso. Then go command will link them
    into your executable automatically.
    Well heck, that works just fine. I haven't got a problem actually
    processing the rc in a separate step, it was just not being able to use go
    build to make the final executable that bothered me. You've made my day,
    good sir!

    --

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 9, '12 at 10:39p
activeOct 10, '12 at 12:33a
posts3
users2
websitegolang.org

2 users in discussion

Ken Allen: 2 posts Brainman: 1 post

People

Translate

site design / logo © 2022 Grokbase