# How to create a plugin from a C library?

**URL:** <https://forums.unrealengine.com/t/how-to-create-a-plugin-from-a-c-library/2553292>\
**Category:** Programming & Scripting\
**Tags:** library, unreal-engine, c, Plugins, CPP\
**Created:** [June 12, 2025, 5:06pm UTC](https://forums.unrealengine.com/t/how-to-create-a-plugin-from-a-c-library/2553292 "2025-06-12T17:06:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![StarkTech47](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/starktech47/32/1079778_2.png) [@StarkTech47](https://forums.unrealengine.com/u/StarkTech47)\
**Post date:** [June 12, 2025, 5:06pm UTC](https://forums.unrealengine.com/t/how-to-create-a-plugin-from-a-c-library/2553292/1 "2025-06-12T17:06:14Z")

</div>

Hello everyone,

I am working on a project in Unreal Engine 5 for which I need to use a specific library. This library is called [HEALPix](https://healpix.sourceforge.io/), and I would like to create a plugin that uses it in Unreal Engine 5.

Fortunately, the [source code](https://sourceforge.net/projects/healpix/) for this library is in C++, so I started by downloading it. I then created a plugin folder and a module inside it, containing an ‘include’ folder and a ‘src’ folder. I then copied and pasted all the .h and .cc files into these folders. Finally, I renamed the .cc files to .cpp.

Everything seemed to be working fine until I noticed that HEALPix uses another library called [cfitsio](https://heasarc.gsfc.nasa.gov/fitsio/fitsio.html). This library is written in C, not C++, and I’m really struggling to implement it as a module for my plugin.

```auto
UnrealHEALPix/
    UnrealHEALPix.uplugin
    Resources/
        Icon128.png
    Source/
        cfitsio/
            cfitsio.Build.cs
            include/
                all .h files
            src/
                all .c files
        HEALPix/
            HEALPix.Build.cs
            include/
                all .h files
            src/
                all .cpp files
        UnrealHEALPix/
            UnrealHEALPix.Build.cs
            Private/
            Public/

```

I noticed that Unreal doesn’t seem to like compiling C files. Also, I get a lot of errors when compiling due to some differences between C and C++.

I’m wondering how to make it work.

If you have any ideas, I would be pleased to read it.
