# CxxWrap on windows

**URL:** <https://discourse.julialang.org/t/cxxwrap-on-windows/65178>\
**Category:** New to Julia\
**Tags:** question, cxx, c, cxxwrap\
**Created:** [July 23, 2021, 1:33pm UTC](https://discourse.julialang.org/t/cxxwrap-on-windows/65178 "2021-07-23T13:33:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gitboy16](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gitboy16/32/24906_2.png) [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Post date:** [July 23, 2021, 1:33pm UTC](https://discourse.julialang.org/t/cxxwrap-on-windows/65178/1 "2021-07-23T13:33:45Z")

</div>

Hi,  
I am trying to use CxxWrap on windows.  
I am trying to reproduce the “hello world” on the github page.

Questions:  
1/ where is `#include "jlcxx/jlcxx.hpp"` ?  
2/ how do I compile to a shared library? ( i have gcc)  
3/ does anyone have a step by step tutorial for windows? The documentation seem a bit light for beginners.

Thank you

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [August 6, 2021, 7:05am UTC](https://discourse.julialang.org/t/cxxwrap-on-windows/65178/2 "2021-08-06T07:05:15Z")

</div>

Summoning @barche

---

<div class="post-metadata">

**Author:** ![barche](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barche/32/79_2.png) [@barche](https://discourse.julialang.org/u/barche)\
**Post date:** [August 6, 2021, 10:30pm UTC](https://discourse.julialang.org/t/cxxwrap-on-windows/65178/3 "2021-08-06T22:30:17Z")

</div>

Hi @gitboy16, sorry for the late reaction.

There are two methods:

1. Use Docker and a dev container, as described here: [https://github.com/barche/cxxwrap-juliacon2020](https://github.com/barche/cxxwrap-juliacon2020) (note that the docker image probably needs updating)
2. Use MSVC Community Edition to check out libcxxwrap-julia from git and build using CMake. This is currently broken, I’m trying to fix it here: [https://github.com/JuliaInterop/libcxxwrap-julia/pull/91](https://github.com/JuliaInterop/libcxxwrap-julia/pull/91)

---

<div class="post-metadata">

**Author:** ![gitboy16](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gitboy16/32/24906_2.png) [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Post date:** [August 7, 2021, 7:16am UTC](https://discourse.julialang.org/t/cxxwrap-on-windows/65178/4 "2021-08-07T07:16:26Z")

</div>

Thank you @barche for the link  
I will try this. Your link mentions Julia 1.4. Will it work with Julia 1.7?  
Julia 1.7 is the only one I can use currently as it has git flag which is configurable to install package that previous version don’t have and is necessary to install packages behind company firewall.

---

<div class="post-metadata">

**Author:** ![barche](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barche/32/79_2.png) [@barche](https://discourse.julialang.org/u/barche)\
**Post date:** [August 7, 2021, 9:26am UTC](https://discourse.julialang.org/t/cxxwrap-on-windows/65178/5 "2021-08-07T09:26:55Z")

</div>

> [@gitboy16](#):
>
> Will it work with Julia 1.7?

I tried the MSVC method with Julia 1.7, but there are many missing definitions, so I still have to look for a workaround. The VScode devcontainer method should work with any Julia version. Which method you need/prefer also depends on the library you want to wrap (i.e. is it easier to build that library with MSVC or GCC?)

---

<div class="post-metadata">

**Author:** ![gitboy16](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gitboy16/32/24906_2.png) [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Post date:** [August 7, 2021, 10:14am UTC](https://discourse.julialang.org/t/cxxwrap-on-windows/65178/6 "2021-08-07T10:14:45Z")

</div>

I really would like to use Boost. Thank you.

---

<div class="post-metadata">

**Author:** ![barche](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barche/32/79_2.png) [@barche](https://discourse.julialang.org/u/barche)\
**Post date:** [August 13, 2021, 11:52pm UTC](https://discourse.julialang.org/t/cxxwrap-on-windows/65178/7 "2021-08-13T23:52:31Z")

</div>

I have updated the VScode devcontainer, see: [https://github.com/barche/cxxwrap-template](https://github.com/barche/cxxwrap-template)

This is based on the official Julia Docker image, so it is still on 1.6 unfortunately.

---

<div class="post-metadata">

**Author:** ![gitboy16](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gitboy16/32/24906_2.png) [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Post date:** [January 16, 2022, 5:09am UTC](https://discourse.julialang.org/t/cxxwrap-on-windows/65178/8 "2022-01-16T05:09:13Z")

</div>

If anyone sees the above thread, please note that @Ronis_BR answers some of my original questions post in the following discussion:

> [@Ccall c++ sort vector of String](https://discourse.julialang.org/t/ccall-c-sort-vector-of-string/74635):
>
> Hi, Would someone be able to provide an example on how to : 1/ pass a vector of strings to ccall 2/ sort the vector of strings using c++ std::sort 3/ get the sorted string vector back in Julia Thank you

Thanks again to @Ronis_BR and @Gnimuc for improving my knowledge.
