How to call functions from UAssetRegistryHelpers in C++?

Hello,
how do I use functions which are defined inside the AssetRegistry/AssetRegistryHelpers.h Header in C++?

I already included the header file and added “AssetRegistry” to my projects PublicDependencyModuleNames (inside the *.Build.cs).
Unfortunately, it won’t compile, it claims there is an “unresolved external symbol” (Linker Tools Error LNK2019).

I am aware that this might be a strange usecase, because those functions might be desinged for calling from Blueprints. Maybe someone still knows how to call them in C++.

The relevant function is declared (as of UE 5.3.2) at Runtime/AssetRegistry/Public/AssetRegistry/AssetRegistryHelpers.h:107 where the function is not marked for export (it’s symbol is hidden). This will prevent linking to it across a module/shared library boundary.

You could modify the file by adding the ASSETREGISTRY_API macro to the function declaration (see line 115 for an example) and recompiling the AssertRegistry module such that the function is exported for use, but this obviously requires a custom build of the engine with the relevant patch distributed to all project members.

If you’re unwilling to use a custom build of the engine the next best thing would be to replicate the functionality of the function (defined at Runtime/AssetRegistry/Private/AssetRegistryHelpers.cpp:152 for reference) in your own code.