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

**URL:** <https://forums.unrealengine.com/t/compiler-linker-errors-for-aatmosphericfog-uatmosphericfogcomponent-setsunmultiplier/275414>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [March 11, 2014, 2:18am UTC](https://forums.unrealengine.com/t/compiler-linker-errors-for-aatmosphericfog-uatmosphericfogcomponent-setsunmultiplier/275414 "2014-03-11T02:18:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ue4-archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ue4-archive](https://forums.unrealengine.com/u/ue4-archive)\
**Post date:** [March 11, 2014, 2:18am UTC](https://forums.unrealengine.com/t/compiler-linker-errors-for-aatmosphericfog-uatmosphericfogcomponent-setsunmultiplier/275414/1 "2014-03-11T02:18:40Z")

</div>

**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 🙂

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

 ![tyepicdevsheart.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/2/b/22ba011743f85d9e0d6c8c3399b7aec99f387b5f.jpeg)

**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++ 🙂**

* * *

* * *

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 🙂

```
    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

🙂

Rama

---

<div class="post-metadata">

**Author:** ![ue4-archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ue4-archive](https://forums.unrealengine.com/u/ue4-archive)\
**Post date:** [March 11, 2014, 2:18am UTC](https://forums.unrealengine.com/t/compiler-linker-errors-for-aatmosphericfog-uatmosphericfogcomponent-setsunmultiplier/275414/2 "2014-03-11T02:18:42Z")

</div>

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 🙂

🙂

---

<div class="post-metadata">

**Author:** ![ue4-archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ue4-archive](https://forums.unrealengine.com/u/ue4-archive)\
**Post date:** [March 11, 2014, 2:18am UTC](https://forums.unrealengine.com/t/compiler-linker-errors-for-aatmosphericfog-uatmosphericfogcomponent-setsunmultiplier/275414/3 "2014-03-11T02:18:43Z")

</div>

Hi Nathan,

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

Thanks,

Sean

---

<div class="post-metadata">

**Author:** ![ue4-archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ue4-archive](https://forums.unrealengine.com/u/ue4-archive)\
**Post date:** [March 11, 2014, 2:18am UTC](https://forums.unrealengine.com/t/compiler-linker-errors-for-aatmosphericfog-uatmosphericfogcomponent-setsunmultiplier/275414/4 "2014-03-11T02:18:43Z")

</div>

okay thanks for the update Sean!

🙂 🙂

Rama

---

<div class="post-metadata">

**Author:** ![ue4-archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ue4-archive](https://forums.unrealengine.com/u/ue4-archive)\
**Post date:** [March 11, 2014, 2:18am UTC](https://forums.unrealengine.com/t/compiler-linker-errors-for-aatmosphericfog-uatmosphericfogcomponent-setsunmultiplier/275414/5 "2014-03-11T02:18:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ue4-archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ue4-archive](https://forums.unrealengine.com/u/ue4-archive)\
**Post date:** [March 11, 2014, 2:18am UTC](https://forums.unrealengine.com/t/compiler-linker-errors-for-aatmosphericfog-uatmosphericfogcomponent-setsunmultiplier/275414/6 "2014-03-11T02:18:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ue4-archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ue4-archive](https://forums.unrealengine.com/u/ue4-archive)\
**Post date:** [March 11, 2014, 2:18am UTC](https://forums.unrealengine.com/t/compiler-linker-errors-for-aatmosphericfog-uatmosphericfogcomponent-setsunmultiplier/275414/7 "2014-03-11T02:18:44Z")

</div>

Thanks Nick!

🙂

Rama
