Skip to content

Building go-gl/gl on Windows

Today I decided I want to continue learning the programming language Go and write a small OpenGL program with it. For OpenGL I wanted to use the Go package “” which usually can be installed with “go get”. This, however, resulted in a bunch of undefined reference errors, because you need to install GLEW beforehand. That on the other hand is not so easy on Windows. While you can download MSVC-compatible .lib files of GLEW and MinGW32 hypothetically can use them, they won’t work for building the gl package (results in other undefined references in the likes of _imp____glew*). Instead, you need to build MinGW32 library files (.a).

Took me some time to figure it out, but these were roughly the steps it required, assuming that Go is already installed:

1. Install MinGW32 and the package mingw32-base
2. Download GLEW source code from
3. Get the build script from
4. Copy the build script into the GLEW source folder and execute it, this will build the library files
5. Copy the static library files (lib/libglew32.a etc.) into your MinGW32 lib folder (e.g. C:\MingW32\lib)
6. Copy the header files (include/GL/glew32.h etc.) into the MingW32 include folder (e.g. C:\MingW32\include\GL)
7. Copy lib/glew32.dll into Windows’ system32 folder
8. go get

After this you should be able to use the gl package.

1 reply »

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


  • I finally reached the stage where I've learned enough about Flutter to start having fun with it. 2 weeks ago
  • If only Dart/Flutter had JSX 3 weeks ago
  • And they're both shit. 3 months ago
  • I still can't get over the fact that JIRA uses two different text editors, one when creating a ticket and another one when editing it. 3 months ago
  • RT @stackblitz: Today we’re excited to bring Node.js back to its roots - the browser! Together with @googlechrome and @vercel, we're enabl… 4 months ago


%d bloggers like this: