# Add custom library

**URL:** <https://forum.legato.io/t/add-custom-library/6835>\
**Category:** Uncategorized\
**Created:** [November 14, 2024, 1:19pm UTC](https://forum.legato.io/t/add-custom-library/6835 "2024-11-14T13:19:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pmark](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@pmark](https://forum.legato.io/u/pmark)\
**Post date:** [November 14, 2024, 1:19pm UTC](https://forum.legato.io/t/add-custom-library/6835/1 "2024-11-14T13:19:14Z")

</div>

I want to add a custom shared library, I can compile it in yocto (using a separate computer)  
so it is in /usr/lib on the target  
But how would i add that to the leaf setup used for VSCode so i can compile against it in my app?  
Can i just copy the needed libraries and header files into /home/pm/.leaf/wp77-toolchain\_SWI9X06Y\_03.00.13.00-linux64/sysroots/armv7a-neon-poky-linux-gnueabi/  
or would that break things ?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [November 14, 2024, 1:56pm UTC](https://forum.legato.io/t/add-custom-library/6835/2 "2024-11-14T13:56:20Z")

</div>

See if this helps to add library in cdef file:

> [@Problems with using libxml2](https://forum.legato.io/t/problems-with-using-libxml2/5521/21):
>
> I suspect the libxml2 you add to the toolchain is not an official one. The official way should be using the libxml2 stuff from yocto recipe. Here is what I try on WP76 source: download the yocto source from [source.sierrawireless.com](http://source.sierrawireless.com)[https://source.sierrawireless.com/resources/airprime/software/wp76xx/wp76xx-firmware-release-13,-d-,1-components/#sthash.2vlTNVx1.dpbs](https://source.sierrawireless.com/resources/airprime/software/wp76xx/wp76xx-firmware-release-13,-d-,1-components/#sthash.2vlTNVx1.dpbs) go to ./meta-swi/meta-swi-mdm9x28/recipes-core/images/mdm9x28-image.inc 3.add the following line: IMAGE\_INSTALL\_append = "…
