-
Notifications
You must be signed in to change notification settings - Fork 0
Setting up BearLibTerminal (Windows)
In order to use Gogue, BearLibTerminal must be present and configured on your system. The choice to use BearLibTerminal (henceforth BLT) was made due to its wonderful set of functionality, and generally easy to use API.
Unfortunately, Windows is the most complicated system to get BearLibTerminal (using the Go bindings, at least) running on, out of the three (Windows, Linux, Mac), due to a lack of GCC compiler, and some other quirks. In particular, we can't use the gogue-framework Go Package, as we need some Windows specific bindings in our BearLibTerminal package. So, these instructions will walk you through creating a local BearLibTerminal Go package to use in your project.
-
Download BLT for Windows here - Make sure to get the Windows distribution. Un-archive it somewhere.
-
In your $GOPATH/src directory, create a new directory called
bearlibterminal
. -
From your BLT download, copy the
BearLibTerminal.dll
andBearLibTerminal.lib
files from theWindows64
directory into your$GOPATH/src/bearlibterminal
directory. -
From your BLT download, copy the
BearLibTerminal.h
file from theInclude/C
directory to your$GOPATH/src/bearlibterminal
directory. -
From your BLT download, copy the
BearLibTerminal.go
file fromInclude/Go
into$GOPATH/src/bearlibterminal
. -
From a terminal, navigate to your
$GOPATH/src/bearlibterminal
directory, and rungo mod init
. This should create ago,mod
file in your bearlibterminal directory, and will allow us to include our BearLibTerminal go library in our projects.
At this point, we'll need to go and download and install a GCC compiler implementation for Windows. There are a couple choices, but I recommend using TDM-GCC (and so does the author of BearLibTerminal), due to its quirks implementations. You can find that here. Grab the latest, and install, ensuring you add it to your PATH. Make sure you install the 64bit version!
-
Copy the
BearLibTerminal.lib
andBearLibTerminal.dll
files to your TDM-GCC installationslib
folder. Mine was located atC:\TDM-GCC-64\lib
, but your location may vary. -
We are finally ready to build our BearLibTerminal Go library! In your
$GOPATH/src/bearlibterminal
, rungo build
. This should result in no output. If thats the case, you're all set to use BearLibTerminal in your Go projects!