[go-nuts] Re: How to dllexport a value symbol within a windows binary executable with Go?

2017-02-20 Thread Hakan Guleryuz
I found a much simpler and cleaner solution without involving any ldflags and without using --export-all-symbols In my main.go (or whatever main package that contains the main func): /* #cgo LDFLAGS: ${SRCDIR}/main.def __declspec(dllexport) unsigned long NvOptimusEnablement = 0x0001; __de

[go-nuts] Re: How to dllexport a value symbol within a windows binary executable with Go?

2017-01-30 Thread Hakan Guleryuz
For anyone who wants to build a windows .exe with go-sdl2 and opengl, and has an optimus driver, and wants to ensure that the high performance gpu is selected by default for their final product, I will document my findings here I found the followingsolution, which can be proven that it work