# Can't link to libcxxwrap\_julia on MacOS

**URL:** <https://discourse.julialang.org/t/cant-link-to-libcxxwrap-julia-on-macos/43657>\
**Category:** New to Julia\
**Created:** [July 25, 2020, 7:25am UTC](https://discourse.julialang.org/t/cant-link-to-libcxxwrap-julia-on-macos/43657 "2020-07-25T07:25:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![liuyxpp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/liuyxpp/32/9870_2.png) [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Post date:** [July 25, 2020, 7:25am UTC](https://discourse.julialang.org/t/cant-link-to-libcxxwrap-julia-on-macos/43657/1 "2020-07-25T07:25:55Z")

</div>

I install and build CxxWrap in the REPL. When I link to it, it fails with message

Undefined symbols for architecture x86\_64:  
“jlcxx::FunctionWrapperBase::FunctionWrapperBase(jlcxx::Module\*, std::pair\<\_jl\_datatype\_t\*, \_jl\_datatype\_t\*\>)”, referenced from:

I compiled my C++ code with GNU g++ 8.2. Does it relate to how the libcxxwrap\_julia is compiled when I install it? Can I explicitly direct it to compile the library using my own g++ but not MacOS native c++?

System info: MacOS 10.15.4, Julia 1.4, CxxWrap 0.11.0

---

<div class="post-metadata">

**Author:** ![liuyxpp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/liuyxpp/32/9870_2.png) [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Post date:** [August 12, 2020, 2:32pm UTC](https://discourse.julialang.org/t/cant-link-to-libcxxwrap-julia-on-macos/43657/2 "2020-08-12T14:32:42Z")

</div>

I solved this problem by building and using my own libcxxwrap-julia binary using local GNU gcc/g++ following this [guide](https://github.com/JuliaInterop/libcxxwrap-julia). Also note that if I change the Julia version, I have to rebuild the package, which means CxxWrap will only work in the version of Julia libcxxwrap-julia compiled with.
