Compiler linker errors for AAtmosphericFog & UAtmosphericFogComponent->SetSunMultiplier()

update2 : My inablilty to get around these compiler linker errors has prevented me from implementing one of my game features and forced me to comment out about 2 hours of work, please let me know when this will be fully corrected, or if my build file is missing something or I’m missing a header or something like that :slight_smile:

PS: I am still absolutely loving UE4! Thank you so much for sharing it with me!

tyepicdevsheart.jpg

update: So I was all excited because I found a workaround to the problem below, by directly finding the UAtmosphericFogComponent in the world

//Retrieve the Atmosphere
	TObjectIterator< UAtmosphericFogComponent > ActorItr2;
	
	//set first found
	if(ActorItr2)
	{
		Optimize("Atmosphere found!");
		Atmosphere = *ActorItr2;
		
	}

So I went to use SetSunMultiplier()

//Atmosphere
  if(VictoryPC->Atmosphere)
    VictoryPC->Atmosphere->SetSunMultiplier( 
	  0.7//FMath::Lerp < float > (VictoryPC->Atmosphere-> SunMultiplier, 0.7, IntroZoomAlpha)
     );

and once again

Got a linker error!

1>Module.VictoryGame.cpp.obj : error LNK2019: unresolved external symbol "public: void __cdecl UAtmosphericFogComponent::SetSunMultiplier(float)" (?SetSunMultiplier@UAtmosphericFogComponent@@QEAAXM@Z) referenced in function "public: void __cdecl AVictoryWarrior::IntroZoomIn(void)" (?IntroZoomIn@AVictoryWarrior@@QEAAXXZ)
1>E:\RocketVictory\VictoryGame\Binaries\Win64\RocketEditor-VictoryGame.dll : fatal error LNK1120: 1 unresolved externals

using

#include "EngineClasses.h"

did not change the compiler error



Please fix this, I cannot modify the atmosphere during runtime from C++ :slight_smile:



Dear Friends at Epic,

I am trying to retrieve the atmospheric fog actor for my level at runtime.

I can verify that there’s an actor in the world that contains the word “atmospheric” in it’s name, but that’s all

I cannot do the following:

 AAtmosphericFog::StaticClass() <--- I get a compiler linker error

 Cast(*ActorItr2); <---- Compiler linker error

 TActorIterator< AAtmosphericFog > ActorItr2 = TActorIterator< AAtmosphericFog >(GetWorld());

 TObjectIterator< AAtmosphericFog > ActorItr2;  //<---- same linker error

The Compiler Linker Error

>    
1>Module.VictoryGame.cpp.obj : error LNK2019: unresolved external symbol "public: static class UClass * __cdecl AAtmosphericFog::GetPrivateStaticClass(wchar_t const *)" (?GetPrivateStaticClass@AAtmosphericFog@@SAPEAVUClass@@PEB_W@Z) referenced in function "public: __cdecl TObjectIterator::TObjectIterator(bool)" (??0?$TObjectIterator@VAAtmosphericFog@@@@QEAA@_N@Z)
1>E:\RocketVictory\VictoryGame\Binaries\Win64\RocketEditor-VictoryGame.dll : fatal error LNK1120: 1 unresolved externals
1> 

This part is of great interest to me, I cant do much about this, I hope you can :slight_smile:

    unresolved external symbol "public: static class UClass * __cdecl
AAtmosphericFog::GetPrivateStaticClass(wchar_t const *)"

From the code below I can only successfully verify that there is an actor in the world whose name contains “Atmospheric” but I cannot cast the actor that has this name for my future use

//Retrieve the Atmosphere
	TObjectIterator< AActor > ActorItr2;
	
	//set first found
	while(ActorItr2)
	{
		
		//if (ActorItr2->IsA(AAtmosphericFog::StaticClass())) //<--- does not compile
		//{

		if(ActorItr2->GetName().Contains(TEXT("Atmospheric")))  //<--- this succeeds
		{
			Optimize("Atmosphere found!");
			//Atmosphere = Cast(*ActorItr2);  //<--- does not compile
			break;
		}
		
		//}
		++ActorItr2;
	}

I am trying to cast to this class:

// Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.


#include "AtmosphericFog.generated.h"

UCLASS(showcategories=(Movement, Rendering, "Transform|Actor"), ClassGroup=Fog, placeable)
class AAtmosphericFog : public AInfo
{
	GENERATED_UCLASS_BODY()

	UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Category=Atmosphere)
	TSubobjectPtr AtmosphericFogComponent;

#if WITH_EDITOR
	void Spawned();
#endif
};

Please let me know what I can do to get the atmospheric fog actor so I can modify it during runtime

:slight_smile:

Rama

I’m still waiting for answer to this, I cannot implement my game feature (which I will show in a video on forum soon as it’s done, yay!)

until this issue is addressed :slight_smile:

:slight_smile:

Hi Nathan,

Thanks for your patience. We’re working towards having a response for you shortly.

Thanks,

Sean

okay thanks for the update Sean!

:slight_smile: :slight_smile:

Rama

I just ran into the same dreaded LNK2019 error, and I can tell you it’s because AtmosphericFog.h does not expose its functions through a public API. So they’re probably going to have to edit the code to do so and it won’t work until a future release.

We need to export the symbols for these classes – we’ll get that done shortly. Thanks for letting us know!

Thanks Nick!

:slight_smile:

Rama