# How to properly integrate libraries into Unreal?

**URL:** <https://forums.unrealengine.com/t/how-to-properly-integrate-libraries-into-unreal/1176583>\
**Category:** C++\
**Tags:** third-party-librarie, unreal-engine, CPP, question\
**Created:** [May 24, 2023, 2:54am UTC](https://forums.unrealengine.com/t/how-to-properly-integrate-libraries-into-unreal/1176583 "2023-05-24T02:54:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aejjee](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/aejjee/32/1204088_2.png) [@Aejjee](https://forums.unrealengine.com/u/Aejjee)\
**Post date:** [May 24, 2023, 2:54am UTC](https://forums.unrealengine.com/t/how-to-properly-integrate-libraries-into-unreal/1176583/1 "2023-05-24T02:54:36Z")

</div>

For a program I am making with UE5 I need to use the netcdf4 libraries. This is their download page:  
[https://downloads.unidata.ucar.edu/netcdf/](https://downloads.unidata.ucar.edu/netcdf/)

I’ve looked into the documentation on implementing third party libraries into unreal and .libs seem to be quite simple, however, .dlls seem to be platform specific. I want to be able to build to windows, mac, and linux, though so how exactly do I implement netcdf such that it preserves cross compatibility?

---

<div class="post-metadata">

**Author:** ![eray\_ozr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eray\_ozr](https://forums.unrealengine.com/u/eray_ozr)\
**Post date:** [May 24, 2023, 7:50am UTC](https://forums.unrealengine.com/t/how-to-properly-integrate-libraries-into-unreal/1176583/2 "2023-05-24T07:50:15Z")

</div>

Look at build.cs and upl.xml (be careful about their includes, too)

> **[PDF\_Reader/Source/PDF\_Reader at main · FF-Projects-UE/PDF\_Reader](https://github.com/FF-Projects-UE/PDF_Reader/tree/main/Source/PDF_Reader)**
>
> main/Source/PDF\_Reader

1. Create a C++project.

2. Create a Plugin from Plugins tab.

3. Add your includes and libraries to your build.cs like sample plugin.

4. If your library is static, you are ready. Just right click your .uproject and select `Generate Visual Studio Project Files`. After that, you can use `include "your_third_party.h"`

5. If your library is dynamic, you have two extra steps for each platform of you supported.

**For Windows:**

1. Create a void\* function in your Plugin\_Name.h like this sample  
[PDF\_Reader/PDF\_Reader.h at main · FF-Projects-UE/PDF\_Reader · GitHub](https://github.com/FF-Projects-UE/PDF_Reader/blob/main/Source/PDF_Reader/Public/PDF_Reader.h)

2. Write a delayed load in your startup module like this.  
[PDF\_Reader/PDF\_Reader.cpp at main · FF-Projects-UE/PDF\_Reader · GitHub](https://github.com/FF-Projects-UE/PDF_Reader/blob/main/Source/PDF_Reader/Private/PDF_Reader.cpp)

**For Android and iOS:**

1. Add your .so files like UPL.xml (you can see it at first link)  
You have to create seperate UPL.xml if you want to support both iOS and Android. If your library is static, you don’t need to create one and add it to your build.cs  
UPL is same for both mobile platform but probably directory structure is different. I don’t have Apple exprience and Apple devices. So, I can’t tell true paths.

As I know Mac doesn’t support delayed loads and they doesn’t support .dll. They have their own dynamic library extension. Build.cs structure will be same. Just add them inside of platform if. If they need another step, I don’t know.

---

<div class="post-metadata">

**Author:** ![Aejjee](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/aejjee/32/1204088_2.png) [@Aejjee](https://forums.unrealengine.com/u/Aejjee)\
**Post date:** [May 25, 2023, 3:47pm UTC](https://forums.unrealengine.com/t/how-to-properly-integrate-libraries-into-unreal/1176583/3 "2023-05-25T15:47:51Z")

</div>

Thank you following those links you provided helped me get it working!

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [June 24, 2023, 3:48pm UTC](https://forums.unrealengine.com/t/how-to-properly-integrate-libraries-into-unreal/1176583/4 "2023-06-24T15:48:49Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
