# Use CxxWrap with embedded julia without shared lib

**URL:** <https://discourse.julialang.org/t/use-cxxwrap-with-embedded-julia-without-shared-lib/119159>\
**Category:** General Usage\
**Tags:** cxxwrap\
**Created:** [September 7, 2024, 7:35am UTC](https://discourse.julialang.org/t/use-cxxwrap-with-embedded-julia-without-shared-lib/119159 "2024-09-07T07:35:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergey](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Sergey](https://discourse.julialang.org/u/Sergey)\
**Post date:** [September 7, 2024, 7:35am UTC](https://discourse.julialang.org/t/use-cxxwrap-with-embedded-julia-without-shared-lib/119159/1 "2024-09-07T07:35:20Z")

</div>

From example i saw that cxxwrap define some module like this

```julia
int greet()
{
    return 12;
}

void define_julia_module(jlcxx::Module& mod)
{
    mod.method("greet", &greet);
}

```

We could create `jlcxx::Module` ++ several ways and i hope to bind functions without building shared dll.

I trying several functions from CxxWrap but everything is crash with read memory.

```julia
    jlcxx::cxxwrap_init();
    jl_module_t* module = jl_new_module(jl_symbol("example"), nullptr);
    jlcxx::Module& newModule = jlcxx::registry().create_module(module);
    newModule.method("greet", &greet);

```

Is it possible or its shared only by design? (jluna provide a way to bind functions embedded way)

Thanks!

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [September 7, 2024, 4:34pm UTC](https://discourse.julialang.org/t/use-cxxwrap-with-embedded-julia-without-shared-lib/119159/2 "2024-09-07T16:34:29Z")

</div>

I would assume that CxxWrap works only with shared libraries. Feel free to create a feature request for CxxWrap to make it work without.

---

<div class="post-metadata">

**Author:** ![Sergey](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Sergey](https://discourse.julialang.org/u/Sergey)\
**Post date:** [September 7, 2024, 4:38pm UTC](https://discourse.julialang.org/t/use-cxxwrap-with-embedded-julia-without-shared-lib/119159/3 "2024-09-07T16:38:38Z")

</div>

I will try.  
Watch their git, almost no activity detected. Read post on discourse that it’s a common situation for many julia repo.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [September 7, 2024, 5:57pm UTC](https://discourse.julialang.org/t/use-cxxwrap-with-embedded-julia-without-shared-lib/119159/4 "2024-09-07T17:57:23Z")

</div>

> [@Sergey](#):
>
> Read post on discourse that it’s a common situation for many julia repo.

This is just not true. Well, some repos are stable, so no activities needed. I know the main author of CxxWrap, he is a prof in Brussels, and profs are always busy. But he is active in the Julia community and will fix issues if needed.

It is strange that you call this “allmost no activity detected”:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/5/95b9850e141dfb99828381ce4f0eb7aa87f5413e.png)

---

<div class="post-metadata">

**Author:** ![Sergey](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Sergey](https://discourse.julialang.org/u/Sergey)\
**Post date:** [September 7, 2024, 7:43pm UTC](https://discourse.julialang.org/t/use-cxxwrap-with-embedded-julia-without-shared-lib/119159/5 "2024-09-07T19:43:34Z")

</div>

Understood.  
Im count on my expirience with pybind11 and luasol which was commited almost every day (when im working with them). Change my opinion on activities.  
Found similar to my issue in c++ repo of CxxWrap (its possibly not important for project).

Thanks
