# I cannot use user-defined struct for my third party library (.dll)

**URL:** <https://forums.unrealengine.com/t/i-cannot-use-user-defined-struct-for-my-third-party-library-dll/2087408>\
**Category:** Programming & Scripting\
**Tags:** third-party-librarie, unreal-engine, CPP, question\
**Created:** [October 25, 2024, 12:13pm UTC](https://forums.unrealengine.com/t/i-cannot-use-user-defined-struct-for-my-third-party-library-dll/2087408 "2024-10-25T12:13:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yldbear77](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@yldbear77](https://forums.unrealengine.com/u/yldbear77)\
**Post date:** [October 25, 2024, 12:13pm UTC](https://forums.unrealengine.com/t/i-cannot-use-user-defined-struct-for-my-third-party-library-dll/2087408/1 "2024-10-25T12:13:20Z")

</div>

Hello. I want to use my own third party library for my current unreal project.  
Here is the struct.

```auto
struct DataTable
{
    int idx;
    int value;
};

```

Here is the dll module and function call.

```auto
DataTable p = {...};
myModule->Load(&p);

```

Load()'s parameter is DataTable\* so it can see what values are in.  
it does not work. It was empty when I called the function everytime.

But once I modified the function to accept parameter as int\*, it works.

```auto
int i = 3;
myModule->Load(&i);

```

It seems only user-defined struct cannot be accepted as a parameter for third library function.  
I really need help. I put an alphabet F in front of struct name. but it did not work, too. Does anyone have an idea to solve this problem ?

Thank you.

---

<div class="post-metadata">

**Author:** ![IrSoil](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IrSoil](https://forums.unrealengine.com/u/IrSoil)\
**Post date:** [October 25, 2024, 2:48pm UTC](https://forums.unrealengine.com/t/i-cannot-use-user-defined-struct-for-my-third-party-library-dll/2087408/2 "2024-10-25T14:48:59Z")

</div>

You should clarify what you mean by `third party library for unreal project`, as there are a few possible ways to build\include third party libraries

But assuming the simplest case, that your library is a separate UE’s module included as a plugin\dependency - here you should mark the classes & other things you export with `__declspec(dllexport)`. In terms of UE it means - add the `%YOUR_MODULE_NAME%_API` macro (so for module named `MyLib` the macro will be `MYLIB_API` ) before the the entities you need to export
