caseymcc / UE4_FastNoise2

Example for importing FastNoise2 into UE4
MIT License
12 stars 0 forks source link

error LNK2019: unresolved external symbol... RESOLVED! #5

Closed markentingh closed 1 month ago

markentingh commented 5 months ago

If you are receiving the following error when building your C++ project:

error LNK2019: unresolved external symbol "__declspec(dllimport) private: static void __cdecl FastNoise::SmartNodeManager::DecReference(unsigned __int64,void ,void (__cdecl)(void *))" (_imp?DecReference@SmartNodeManager@FastNoise@@CAX_KPEAXP6AX1@Z@Z) referenced in function "private: void __cdecl FastNoise::SmartNode::Release(void)" (?Release@?$SmartNode@VGenerator@FastNoise@@@fastnoise@@AEAAXXZ)

Found a solution here

Quoting from the above link:

I was able to resolve this myself in this way:

// FastNoise_Config.h -#define FASTNOISE_USE_SHARED_PTR false +#define FASTNOISE_USE_SHARED_PTR true // The only place I #include FastNoise

define FASTNOISE_STATIC_LIB

include <FastNoise/FastNoise.h>

I was using UnrealCMake to compile FastNoise from source.

Basically, I had to go into the FastNoise2 cloned repo and change the line for #define FASTNOISE_USE_SHARED_PTR false and set it to true, then add #define FASTNOISE_STATIC_LIB above the line #include <FastNoise/FastNoise.h> anywhere I include FastNoise in my project.

InfiniteLife commented 2 months ago

Thank you! For me using #define FASTNOISE_STATIC_LIB was enough