[SOLVED]Issue getting UWindDirectionalSourceComponent from AWindDirectionalSource

Hi all,

I’m trying to set the WindSpeed on the UWindDirectionalSourceComponent of my AWindDirectionalSource but am getting a fatal error LNK1120: 1 unresolved externals. I’ve included the Header file etc and tried every permutation I can think of (noob c++ guy here i’m afraid).


// Increase Wind
//UWindDirectionalSourceComponent* windsourcecomponent = WindSourceActor->GetComponent();
//windsourcecomponent->SetSpeed(0.5f);
WindSourceActor->GetComponent()->SetSpeed(0.5f);
//if (WindSourceSystem)WindSourceSystem->SetSpeed(0.5f);

You can see from the above the different things i’ve tried.

Error Message thus…


1>     Creating library H:\UE4 Projects\MM2EE_UE4\Intermediate\Build\Win64\UE4Editor\Development\MM2\UE4Editor-MM2-2342.suppressed.lib and object H:\UE4 Projects\MM2EE_UE4\Intermediate\Build\Win64\UE4Editor\Development\MM2\UE4Editor-MM2-2342.suppressed.exp
1>Module.MM2.cpp.obj : error LNK2019: unresolved external symbol "public: void __cdecl UWindDirectionalSourceComponent::SetSpeed(float)" (?SetSpeed@UWindDirectionalSourceComponent@@QEAAXM@Z) referenced in function "private: void __cdecl AWeatherManager::ProcessWeatherStateChange(void)" (?ProcessWeatherStateChange@AWeatherManager@@AEAAXXZ)
1>H:\UE4 Projects\MM2EE_UE4\Binaries\Win64\UE4Editor-MM2-2342.dll : fatal error LNK1120: 1 unresolved externals

Any help greatly received.

Many thanks in advance,
Matt.

For some stupid reason, the WindDirectionalSourceComponent is tagged with MinimalAPI which means you can’t call any of it’s functions from your own Project (it’s not exported - which is why you’re getting a LINK error).

WindDirectionalSourceComponent is just a container for properties, it doesn’t actually do anything - so my advice would be to just create your own component / actor that copies what it does - and change the references to your own component type.

Alternatively, if you’re working from engine source, remove the MinimalAPI flag and add ENGINE_API to the original component.

Many thanks for the reply TheJamsh!

I’ve got around the issue by exposing the function to Blueprints. You can call the Setters from there.

Thanks again.