# Dune, virtual libraries and their implementation

**URL:** <https://discuss.ocaml.org/t/dune-virtual-libraries-and-their-implementation/15426>\
**Category:** Ecosystem\
**Tags:** dune\
**Created:** [October 11, 2024, 12:05pm UTC](https://discuss.ocaml.org/t/dune-virtual-libraries-and-their-implementation/15426 "2024-10-11T12:05:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nyavlys](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/nyavlys/32/2550_2.png) [@Nyavlys](https://discuss.ocaml.org/u/Nyavlys)\
**Post date:** [October 11, 2024, 12:05pm UTC](https://discuss.ocaml.org/t/dune-virtual-libraries-and-their-implementation/15426/1 "2024-10-11T12:05:31Z")

</div>

Hi,

I’m playing with the dune virtual library feature.  
So far, I succeeded in defining a virtual library `vLib` and two implementations (`impl_lib1` and '`impl_lib2`, with a field `(implements vLib)`) for it.

I can switch between them adding to the `library` stanza of the virtual library the following field:

```auto
(default_implementation impl_lib1)

```

or

```auto
(default_implementation impl_lib2)

```

However, if I remove this field, `dune build` complains that “No implementation found for virtual library”.

So, I’m wondering:

- whether a default implementation should always be defined (it’s not clear to me from the documentation)
- if not, why isn’t any of the implementation found?

Thanks for your help,

Sylvain
