# Compilation golang binding on Windows 10

**URL:** <https://forums.foundationdb.org/t/compilation-golang-binding-on-windows-10/1705>\
**Category:** Using FoundationDB\
**Tags:** bindings\
**Created:** [October 28, 2019, 8:42pm UTC](https://forums.foundationdb.org/t/compilation-golang-binding-on-windows-10/1705 "2019-10-28T20:42:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivvist](https://avatars.discourse-cdn.com/v4/letter/i/da6949/32.png) [@ivvist](https://forums.foundationdb.org/u/ivvist)\
**Post date:** [October 28, 2019, 8:42pm UTC](https://forums.foundationdb.org/t/compilation-golang-binding-on-windows-10/1705/1 "2019-10-28T20:42:53Z")

</div>

According to [foundationdb.org](http://foundationdb.org) I installed Client and Serger of FoundationDB: (foundationdb-6.2.7-x64.msi)

Now I want to use the foundationdb server in my GO module.  
It gets last version.

> go build  
> gives me  
> …  
> C:\Users.…\go\pkg\mod\github.com\apple\foundationdb\bindings\go@v0.0.0-20191027010432-529b35a88625\src\fdb\cluster.go:26:11: fatal error: foundationdb/fdb\_c.h: No such file or directory  
> // #include \<foundationdb/fdb\_c.h\>  
> ^ ~~~~~~~~~~~~~~~~~~~~~  
> compilation terminated.

What exactly should I make yet on my Windows to be able to build my project?  
Thank you in advance.

---

<div class="post-metadata">

**Author:** ![alexmiller](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/alexmiller/32/326_2.png) [@alexmiller](https://forums.foundationdb.org/u/alexmiller)\
**Post date:** [October 29, 2019, 7:13am UTC](https://forums.foundationdb.org/t/compilation-golang-binding-on-windows-10/1705/2 "2019-10-29T07:13:23Z")

</div>

If I’ve made sense of the windows installer code correctly, it’s that the installer drops fdb\_c.h into ProgramFiles/foundationdb/include/foundationdb/fdb\_c.h , which probably isn’t on the default search path for MSVC. You’d need to either add `foundationdb/fdb_c.h` to MSVC’s default include directories, or configure `go build` to add the directory as an include path.

If you wouldn’t mind [filing an issue](https://github.com/apple/foundationdb/issues/new) with reproduction instructions, I’d appreciate it, as you probably won’t be the last person to run into this issue.

---

<div class="post-metadata">

**Author:** ![ivvist](https://avatars.discourse-cdn.com/v4/letter/i/da6949/32.png) [@ivvist](https://forums.foundationdb.org/u/ivvist)\
**Post date:** [October 29, 2019, 6:35pm UTC](https://forums.foundationdb.org/t/compilation-golang-binding-on-windows-10/1705/3 "2019-10-29T18:35:18Z")

</div>

Alex, I use Visual Studio code as IDE for GO development.  
Do you know where should I set “MSVC’s default include directories” exactly?  
or how “configure `go build` to add the directory as an include path”  
?

---

<div class="post-metadata">

**Author:** ![alexmiller](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/alexmiller/32/326_2.png) [@alexmiller](https://forums.foundationdb.org/u/alexmiller)\
**Post date:** [October 29, 2019, 10:53pm UTC](https://forums.foundationdb.org/t/compilation-golang-binding-on-windows-10/1705/4 "2019-10-29T22:53:38Z")

</div>

I don’t particularly have a windows box on hand with a go development environment set up, so I can’t actually offer concrete instructions. I would imagine that somewhere on google you’d be able to learn about “msvc default include path” or “go build c include path” ?

---

<div class="post-metadata">

**Author:** ![Wade](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/wade/32/826_2.png) [@Wade](https://forums.foundationdb.org/u/Wade)\
**Post date:** [November 7, 2019, 2:43am UTC](https://forums.foundationdb.org/t/compilation-golang-binding-on-windows-10/1705/5 "2019-11-07T02:43:54Z")

</div>

Hey there,

I was recently messing around with doing some development on windows with go as well. This is just about pointing to the correct header files. I had to make a change on my system to the cluster.go file:

```
// FoundationDB Go API

package fdb

// #cgo CFLAGS: -I"C:/Program Files/foundationdb/include"
// #cgo LDFLAGS: -L"C:/Program Files/foundationdb/bin" -lfdb_c
// #define FDB_API_VERSION 620
// #include <foundationdb/fdb_c.h>
import "C"

```

However, I ran into a separate issue, which is I don’t think the windows DLLs / Client are compiled with TLS:

```
> fdbcli.exe --tls_certificate_file=fdb.pem --tls_ca_file=ca.crt --log
FoundationDB CLI 6.2 (v6.2.7)
usage: C:\Program Files\foundationdb\bin\fdbcli.exe [OPTIONS]

  -C CONNFILE The path of a file containing the connection string for the
                 FoundationDB cluster. The default is first the value of the
                 FDB_CLUSTER_FILE environment variable, then `./fdb.cluster',
                 then `C:\ProgramData\foundationdb\fdb.cluster'.
  --log Enables trace file logging for the CLI session.
  --log-dir PATH Specifes the output directory for trace files. If
                 unspecified, defaults to the current directory. Has
                 no effect unless --log is specified.
  --trace_format FORMAT
                 Select the format of the log files. xml (the default) and json
                 are supported. Has no effect unless --log is specified.
  --exec CMDS Immediately executes the semicolon separated CLI commands
                 and then exits.
  --no-status Disables the initial status check done when starting
                 the CLI.
  -v, --version Print FoundationDB CLI version information and exit.
  -h, --help Display this help and exit.
```

---

<div class="post-metadata">

**Author:** ![alexmiller](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/alexmiller/32/326_2.png) [@alexmiller](https://forums.foundationdb.org/u/alexmiller)\
**Post date:** [November 7, 2019, 2:47am UTC](https://forums.foundationdb.org/t/compilation-golang-binding-on-windows-10/1705/6 "2019-11-07T02:47:25Z")

</div>

> [@Wade](#):
>
> However, I ran into a separate issue, which is I don’t think the windows DLLs / Client are compiled with TLS:

It requires some additional local setup. If CMake sees that you don’t have a TLS library available, it will disable TLS. The instructions to set up TLS support are in the second half of [the windows build instructions](https://github.com/apple/foundationdb#windows).

---

<div class="post-metadata">

**Author:** ![Wade](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/wade/32/826_2.png) [@Wade](https://forums.foundationdb.org/u/Wade)\
**Post date:** [November 7, 2019, 2:55am UTC](https://forums.foundationdb.org/t/compilation-golang-binding-on-windows-10/1705/7 "2019-11-07T02:55:12Z")

</div>

I didn’t build / compile the client library, I [downloaded](https://www.foundationdb.org/downloads/6.2.7/windows/installers/foundationdb-6.2.7-x64.msi) it

---

<div class="post-metadata">

**Author:** ![alexmiller](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/alexmiller/32/326_2.png) [@alexmiller](https://forums.foundationdb.org/u/alexmiller)\
**Post date:** [November 8, 2019, 9:18am UTC](https://forums.foundationdb.org/t/compilation-golang-binding-on-windows-10/1705/8 "2019-11-08T09:18:32Z")

</div>

Well, that’s embarressing then. I don’t see an issue that exists for this, so [I’ve filed one](https://github.com/apple/foundationdb/issues/2332).
