Trying to get Quartz in a C++ class creating linker errors.

Hi everyone,

I’m currently trying to create a new Actor derived class for my Unreal Project called MainClock.

The idea for this class is it will create a quartz clock and will dispatch events to other Actors with a certain interface.

Whenever I try to create a new or access the Quartz subsystem I get this error in Rider: linker command failed with exit code 1 (use -v to see invocation).

Any help or advice would be appreciated as I can’t seem to find much documentation or online discussion on how to interface with the Quartz subsystem.

My code is below:

header:

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Quartz/QuartzSubsystem.h"
#include "MainClock.generated.h"


UCLASS()
class PLAYGROUND_LITE_API AMainClock : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	AMainClock();

	UPROPERTY(EditAnywhere)
	class UQuartzSubsystem* Quartz;

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

};

cpp:

#include "MainClock.h"
#include "Quartz/QuartzSubsystem.h"

// Sets default values
AMainClock::AMainClock()
{
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;
	
	
}

// Called when the game starts or when spawned
void AMainClock::BeginPlay()
{
	Super::BeginPlay();
	
	UWorld* World = GetWorld();
	Quartz = UQuartzSubsystem::Get(World);
	
}

// Called every frame
void AMainClock::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

}

Have you included the AudioMixer module in you build file?
It’s the module required for quartz to work

PublicDependencyModuleNames.AddRange(new string[] {  ... "AudioMixer" })

The staff also tackled a problem with quartz not long ago it might help

Thanks for the tip! I wasn’t aware that individual modules needed adding to the build in that way but that’s useful to know and it solved my linker error! Many thanks :slight_smile:

1 Like