I’ve updated VS2017 to the latest 15.3.2
Since then the version 4.17.1 does not compile anymore.
In version 4.15.3 it compiles but my project generates unresolved external symbol for the UTimelineComponent
Something should be wrong in UE source file since the VS2017 update.
2> Creating library D:\KadeoGames\UDK\KSGM\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-KSGM.lib and object D:\KadeoGames\UDK\KSGM\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-KSGM.exp
2> Creating library D:\KadeoGames\UDK\KSGM\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-KSGM.suppressed.lib and object D:\KadeoGames\UDK\KSGM\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-KSGM.suppressed.exp
2>KTimelineObject.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl UTimelineComponent::GetLifetimeReplicatedProps(class TArray<class FLifetimeProperty,class FDefaultAllocator> &)const " (?GetLifetimeReplicatedProps@UTimelineComponent@@UEBAXAEAV?$TArray@VFLifetimeProperty@@VFDefaultAllocator@@@@@Z)
2>KSGM.generated.1.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl UTimelineComponent::GetLifetimeReplicatedProps(class TArray<class FLifetimeProperty,class FDefaultAllocator> &)const " (?GetLifetimeReplicatedProps@UTimelineComponent@@UEBAXAEAV?$TArray@VFLifetimeProperty@@VFDefaultAllocator@@@@@Z)
2>KTimelineObject.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl UTimelineComponent::TickComponent(float,enum ELevelTick,struct FActorComponentTickFunction *)" (?TickComponent@UTimelineComponent@@UEAAXMW4ELevelTick@@PEAUFActorComponentTickFunction@@@Z)
2>KSGM.generated.1.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl UTimelineComponent::TickComponent(float,enum ELevelTick,struct FActorComponentTickFunction *)" (?TickComponent@UTimelineComponent@@UEAAXMW4ELevelTick@@PEAUFActorComponentTickFunction@@@Z)
2>KTimelineObject.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl UTimelineComponent::Activate(bool)" (?Activate@UTimelineComponent@@UEAAX_N@Z)
2>KSGM.generated.1.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl UTimelineComponent::Activate(bool)" (?Activate@UTimelineComponent@@UEAAX_N@Z)
2>KTimelineObject.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl UTimelineComponent::Deactivate(void)" (?Deactivate@UTimelineComponent@@UEAAXXZ)
2>KSGM.generated.1.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl UTimelineComponent::Deactivate(void)" (?Deactivate@UTimelineComponent@@UEAAXXZ)
2>KTimelineObject.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl UTimelineComponent::IsReadyForOwnerToAutoDestroy(void)const " (?IsReadyForOwnerToAutoDestroy@UTimelineComponent@@UEBA_NXZ)
2>KSGM.generated.1.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl UTimelineComponent::IsReadyForOwnerToAutoDestroy(void)const " (?IsReadyForOwnerToAutoDestroy@UTimelineComponent@@UEBA_NXZ)
2>D:\KadeoGames\UDK\KSGM\Binaries\Win64\UE4Editor-KSGM.dll : fatal error LNK1120: 5 unresolved externals
2>ERROR : UBT error : Failed to produce item: D:\KadeoGames\UDK\KSGM\Binaries\Win64\UE4Editor-KSGM.dll
The class deriving from UTimelineComponent was working before the update.
/**
* @brief Interface of the UKTimelineObject class.
*
* @info Copyright (c) 2015 Kadeo. All rights reserved.
*
* This source code is only intended as a supplement to the Kadeo User's Guide and
* related electronic documentation provided with the library. See these sources for
* detailed information regarding the Kadeo product.
*
* @author dominique.aigroz@kadeo.net
* @date 16.05.2015
*
* @file D:\KadeoGames\UDK\KSGM\Source\KSGM\Helpers\UObjects\KTimelineObject.h
*/
#pragma once
#include "Components/TimelineComponent.h"
#include "KTimelineObject.generated.h"
/**
* UKTimelineObject implements a UTimelineComponent.
* Events can be triggered at keyframes along the timeline.
* Floats, vectors, and colors are interpolated between keyframes along the timeline.
*/
UCLASS()
class KSGM_API UKTimelineObject : public UTimelineComponent
{
GENERATED_UCLASS_BODY()
public:
/**
* @brief Initializes the timeline with a vector curve and set the tick and finish call-back functions.
*
* @param VectorCurve If non-null, the vector curve.
* @param TickFunc The function to call on every tick.
* @param FinishedFunc The finished function.
* @param InOwner The actor owner.
* @param InPlayRate (Optional) the play rate. Default is 1.0
* @param InLengthMode (Optional) the in length mode. Default is ETimelineLengthMode::TL_TimelineLength.
* @param InLength (Optional) the initial length. Default is 100.
* @param PropertyName (Optional) name of the property. Default is NAME_None.
*/
void Initialize(class UCurveVector* VectorCurve, FOnTimelineVector TickFunc, FOnTimelineEvent FinishedFunc, const AActor* InOwner, float InPlayRate = 1.0f, ETimelineLengthMode InLengthMode = ETimelineLengthMode::TL_TimelineLength, const float InLength = 100.0f, FName PropertyName = NAME_None);
/**
* @brief Initializes the timeline with a float curve and set the tick and finish call-back functions.
*
* @param FloatCurve If non-null, the float curve.
* @param TickFunc The function to call on every tick.
* @param FinishedFunc The finished function.
* @param InOwner The actor owner.
* @param InPlayRate (Optional) the play rate. Default is 1.0
* @param InLengthMode (Optional) the in length mode. Default is ETimelineLengthMode::TL_TimelineLength.
* @param InLength (Optional) the initial length. Default is 100.
* @param PropertyName (Optional) name of the property. Default is NAME_None.
*/
void Initialize(class UCurveFloat* FloatCurve, FOnTimelineFloat TickFunc, FOnTimelineEvent FinishedFunc, const AActor* InOwner, float InPlayRate = 1.0f, ETimelineLengthMode InLengthMode = ETimelineLengthMode::TL_TimelineLength, const float InLength = 100.0f, FName PropertyName = NAME_None);
/**
* @brief Initializes the timeline with a linear color curve and set the tick and finish call-back functions.
*
* @param LinearColorCurve If non-null, the linear color curve.
* @param TickFunc The function to call on every tick.
* @param FinishedFunc The finished function.
* @param InOwner The actor owner.
* @param InPlayRate (Optional) the play rate. Default is 1.0
* @param InLengthMode (Optional) the in length mode. Default is ETimelineLengthMode::TL_TimelineLength.
* @param InLength (Optional) the initial length. Default is 100.
* @param PropertyName (Optional) name of the property. Default is NAME_None.
*/
void Initialize(class UCurveLinearColor* LinearColorCurve, FOnTimelineLinearColor TickFunc, FOnTimelineEvent FinishedFunc, const AActor* InOwner, float InPlayRate = 1.0f, ETimelineLengthMode InLengthMode = ETimelineLengthMode::TL_TimelineLength, const float InLength = 100.0f, FName PropertyName = NAME_None);
/** Get the initial length of the timeline */
float GetInitialTimelineLength() const;
/**
* @brief Sets initial timeline length.
* @param InLength The new initial time length.
*/
void SetInitialTimelineLength(const float InLength);
/** @brief Sets back the timeline length to initial length. */
void SetTimelineLengthToInitial();
private:
/** @brief The initial timeline length. */
float InitialTimelineLength;
};
/**
// End of D:\KadeoGames\UDK\KSGM\Source\KSGM\Helpers\UObjects\KTimelineObject.h
*/
and cpp
/**
* @brief Implementation of the UKTimelineObject class.
*
* @info Copyright (c) 2015 Kadeo. All rights reserved.
*
* This source code is only intended as a supplement to the Kadeo User's Guide and
* related electronic documentation provided with the library. See these sources for
* detailed information regarding the Kadeo product.
*
* @author dominique.aigroz@kadeo.net
* @date 16.05.2015
*
* @file D:\KadeoGames\UDK\KSGM\Source\KSGM\Helpers\UObjects\KTimelineObject.cpp
*/
#include "KSGM.h"
#include "KTimelineObject.h"
UKTimelineObject::UKTimelineObject(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
, InitialTimelineLength(5.0f)
{
}
void UKTimelineObject::Initialize(UCurveVector* VectorCurve, FOnTimelineVector TickFunc, FOnTimelineEvent FinishedFunc, const AActor* InOwner, float InPlayRate, ETimelineLengthMode InLengthMode, const float InLength, FName PropertyName)
{
AddInterpVector(VectorCurve, TickFunc, PropertyName);
SetTimelineFinishedFunc(FinishedFunc);
SetTimelineLengthMode(InLengthMode);
SetPlayRate(InPlayRate);
SetInitialTimelineLength(InLength);
// Don't forget to register the component for ticking
RegisterComponent();
}
void UKTimelineObject::Initialize(UCurveFloat* FloatCurve, FOnTimelineFloat TickFunc, FOnTimelineEvent FinishedFunc, const AActor* InOwner, float InPlayRate, ETimelineLengthMode InLengthMode, const float InLength, FName PropertyName)
{
AddInterpFloat(FloatCurve, TickFunc, PropertyName);
SetTimelineFinishedFunc(FinishedFunc);
SetTimelineLengthMode(InLengthMode);
SetPlayRate(InPlayRate);
SetInitialTimelineLength(InLength);
RegisterComponent();
}
void UKTimelineObject::Initialize(UCurveLinearColor* LinearColorCurve, FOnTimelineLinearColor TickFunc, FOnTimelineEvent FinishedFunc, const AActor* InOwner, float InPlayRate, ETimelineLengthMode InLengthMode, const float InLength, FName PropertyName)
{
AddInterpLinearColor(LinearColorCurve, TickFunc, PropertyName);
SetTimelineFinishedFunc(FinishedFunc);
SetTimelineLengthMode(InLengthMode);
SetPlayRate(InPlayRate);
SetInitialTimelineLength(InLength);
RegisterComponent();
}
float UKTimelineObject::GetInitialTimelineLength() const
{
return InitialTimelineLength;
}
void UKTimelineObject::SetInitialTimelineLength(const float InLength)
{
InitialTimelineLength = InLength;
SetTimelineLengthToInitial();
}
void UKTimelineObject::SetTimelineLengthToInitial()
{
SetTimelineLength(InitialTimelineLength);
}
/**
// End of D:\KadeoGames\UDK\KSGM\Source\KSGM\Helpers\UObjects\KTimelineObject.cpp
*/