GeneratedMeshComponent: LNK2019 MemoryBarrier

Hello :slight_smile:

After integrating the example for generating mesh components at runtime (A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums - I took the code from the github example (ProceduralMeshComponent)) in my Unreal Engine 4.7.6 project I faced the following error:

error LNK2019: unresolved external symbol ""__declspec(dllimport) public: static void __cdecl FWindowsPlatformMisc::MemoryBarrier(void)" (__imp_?MemoryBarrier@FWindowsPlatformMisc@@SAXXZ)" in Function ""public: struct FLockFreeVoidPointerListBase::FLink * __cdecl FLockFreeVoidPointerListBase::FLinkAllocator::AllocateLink(void *)" (?AllocateLink@FLinkAllocator@FLockFreeVoidPointerListBase@@QEAAPEAUFLink@2@PEAX@Z)".	[...]\Intermediate\ProjectFiles\GeneratedMeshComponent.cpp.obj

I had this error already before (in my 1 week since I’m working with Unreal) and solved it by implementing

static void MemoryBarrier() { }

(as shown here: Project fails to compile - C++ - Epic Developer Community Forums). This method is still there but that doesn’t seem to influence the error since this searches for an dll (__declspec(dllimport)). My first thought was to rebuild the engine so that the above fix is contained in the dll. But by doing so, I recognized that VS2013 only printed 2 lines at build:

1>------ Build started: Project: UE4, Configuration: BuiltWithUnrealBuildTool v64 ------
========== Build: 1 successful, 0 error, 0 actual, 0 skipped==========

(freely translated from german). I guess this is due to the given command lines in the project properties under “NMake” with are:

@rem Nothing to do.

Is this due to, that I have invoked “Generate project files” on my project?
I don’t have any clue how to solve this error or even how to rebuild the engine (if this would even help). I appreciate any help! :slight_smile:

I hope, I mentioned all important things, you need to know.

Thank you very much!

Does no one have any idea? Please help, I’m totally stuckon this :frowning:

I’ve tested today to implement the procedural mesh component in a new project. Unfortunately with no success (same error as above).

Something I didn’t mentioned above: I had to change the code in order to compile with Unreal Engine 4.7.6 (I think that this is due to version differences). Things I changed:

  • SafeNormals() to GetSafeNormals()
  • GetTypedData() in GetData()
  • OVERRIDE in override
  • FPostConstructInitializeProperties in FObjectInitializer
  • the line “MaterialProxy = &WireframeMaterialInstance;” in “MaterialProxy = WireframeMaterialInstance;” (error: FColorMaterialRenderProxy** couldn’t be converted in FMaterialRenderProxy*)

Nothing really special, but maybe it helps finding a solution!