# UE5.1 C++, trouble loading .dll (FastNoise2) build with UE4CMake

**URL:** <https://forums.unrealengine.com/t/ue5-1-c-trouble-loading-dll-fastnoise2-build-with-ue4cmake/1300365>\
**Category:** C++\
**Tags:** unreal-engine, dll-missing, question\
**Created:** [September 17, 2023, 3:52pm UTC](https://forums.unrealengine.com/t/ue5-1-c-trouble-loading-dll-fastnoise2-build-with-ue4cmake/1300365 "2023-09-17T15:52:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stewinjo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Stewinjo](https://forums.unrealengine.com/u/Stewinjo)\
**Post date:** [September 17, 2023, 3:52pm UTC](https://forums.unrealengine.com/t/ue5-1-c-trouble-loading-dll-fastnoise2-build-with-ue4cmake/1300365/1 "2023-09-17T15:52:34Z")

</div>

Hey everyone,

i am currently facing problems trying to use a .dll that i build with [UE4CMake](https://github.com/caseymcc/UE4CMake). Funnily enough i had it working for just the use in Editor till i tried to package the project and it broke completely.

The library i am trying to use is [FastNoise2](https://github.com/Auburn/FastNoise2), which is actually featured as an example by UE4CMake which sadly didn’t help me. I have followed the example and instructions and anded up with the current configuration:

Build.cs :

`CMakeTarget.add(Target, this, "FastNoise", Path.Combine(this.ModuleDirectory, "../FastNoise2"), "-D FSTNOISE2_NOISETOOL=OFF -D FASTNOISE2_TESTS=OFF -D BUILD_SHARED_LIBS=ON"); PublicDelayLoadDLLs.Add("FastNoise.dll"); PublicIncludePaths.Add("PROJECTPATH\\Intermediate\\CMakeTarget\\FastNoise\\build\\FastNoise\\src\\Release\\");`

[PublicDelayLoadDLLs](https://docs.unrealengine.com/5.1/en-US/integrating-third-party-libraries-into-unreal-engine/) is there as a test and so that i can continue working as long as i don’t want to use the library. I do know, that this option needs an additional thunk function, which, to be honest, i haven’t tried to make yet as i couldn’t find a guide or example how to do it properly. As far as i understand it, UE4CMake makes this unnecessary however.

I double checked the directories/paths several times and they are correct, i can physically find the FastNoise.dll too. I tried PublicIncludePaths, although i can see the Path being added by UE4CMake, because i can not see Unreal searching this directory inside the Engine Log:

```auto
LogWindows: Failed to load 'PROJECTPATH/Binaries/Win64/UnrealEditor-Minesweeper.dll' (GetLastError=126) 
LogWindows: Missing import: FastNoise.dll LogWindows: Looked in: ../../../Engine/Binaries/Win64
...

```

Would this maybe just not log here ?

Build Output:

`Add library path: "PROJECTPATH/Intermediate/CMakeTarget/FastNoise/build/FastNoise/src/Release"`

.uproject:

`{ "Name": "CMakeTarget", "Enabled": true },`

Any help or hint would be greatly appreciated.

FYI. UE4CMake does/did not work with \> UE5.1 by the time tested it. Unreal changed a functions return type which the plugin not yet handles. Therefore i am on 5.1 currently.
