# CxxWrap: building a module for Windows with Cygwin and MingW?

**URL:** <https://discourse.julialang.org/t/cxxwrap-building-a-module-for-windows-with-cygwin-and-mingw/51539>\
**Category:** General Usage\
**Tags:** cxx\
**Created:** [December 9, 2020, 5:42pm UTC](https://discourse.julialang.org/t/cxxwrap-building-a-module-for-windows-with-cygwin-and-mingw/51539 "2020-12-09T17:42:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpeeter](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@jpeeter](https://discourse.julialang.org/u/jpeeter)\
**Post date:** [December 9, 2020, 5:42pm UTC](https://discourse.julialang.org/t/cxxwrap-building-a-module-for-windows-with-cygwin-and-mingw/51539/1 "2020-12-09T17:42:12Z")

</div>

I am building a library for Kerberos integration, using CxxWrap to expose some functionality to Julia. This works fine on Linux, but on Windows I’m struggling to get the right toolchain. IIUC - in order to avoid having to compile libcxxwrap-julia on the user side (this lib is meant to be distributed widely), I should compile with a GCC-compatible compiler. On Windows, though, I generally use VS.

I’m aware this might only slightly be Julia related, but I’ve been trying to set-up Cygwin and mingw32, which I believe is what CxxWrap is using, but then I have small issues with the Windows-specific part of the build.

Specifically,

```julia
    src/cpp/dsg-kerberos/windows/kerberossspi.h:31:74: error: ‘SecPkgContext_Bindings’ has not been declared
   31 | INT auth_sspi_client_step(sspi_client_state *state, SEC_CHAR *challenge, SecPkgContext_Bindings *sec_pkg_context_bindings);

```

even though sspi,h is included. I must admit I’m fairy new at compiling for Windows.

Happy to go down the rabbit hole, but  
[A] I’m wondering if this is the right path?  
[B] Perhaps someone has a quick idea!

I’m using Julia 1.5.3. I’m using Cygwin with CMake and Ninja, and mingw x64\_86 compilers installed. The code works fine with GCC on Linux and with Visual Studio on Windows (but with VS I can’t use it with the julia wrapper).

---

<div class="post-metadata">

**Author:** ![jpeeter](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@jpeeter](https://discourse.julialang.org/u/jpeeter)\
**Post date:** [December 10, 2020, 11:59am UTC](https://discourse.julialang.org/t/cxxwrap-building-a-module-for-windows-with-cygwin-and-mingw/51539/2 "2020-12-10T11:59:18Z")

</div>

Turns out this was even more unrelated than I thought. I did get it working with mingw64, but it includes an sspi.h that is less complete than Visual Studio’s, so some of the functionality is not supported.
