LNK2019: unresolved external symbol in plugin compile

Hello,
I’m creating a new viewport in a plugin and would like to use the FilmOverlays in the Cinematic Viewport within the LevelSequenceEditor module. Referencing FilmOverlays.h compiles successfully but trying to use any class from it throws unresolved external symbol errors. I’m currently testing on version 4.27.2

Module.MyViewport.cpp.obj : error LNK2019: unresolved external symbol "public: void __cdecl SFilmOverlayOptions::Construct(struct SFilmOverlayOptions::FArguments const &)" (?Construct@SFilmOverlayOptions@@QEAAXAEBUFArguments@1@@Z) referenced in function "public: void __cdecl SMyLevelViewport::Construct(struct SMyLevelViewport::FArguments const &)" (?Construct@SMyLevelViewport@@QEAAXAEBUFArguments@1@@Z)
D:\Unreal Projects\testproject\Plugins\MyViewport\Binaries\Win64\UE4Editor-MyViewport.dll : fatal error LNK1120: 1 unresolved externals

I have the module referenced in my build.cs

		PrivateDependencyModuleNames.AddRange(
				new string[]
				{
					"AppFramework",
					"Core",
					"CoreUObject",
					"EditorStyle",
					"Engine",
					"InputCore",
					"Kismet",
					"KismetCompiler",
					"LevelEditor",
					"Sequencer",
					"Slate",
					"SlateCore",
					"Sequencer",
					"UnrealEd",
					"LevelSequenceEditor",
				}
			);

Within and the FilmOverlay header is included in SMyLevelViewport.cpp

#include "SMyLevelViewport.h"
#include "SLevelViewport.h"
#include "ISequencer.h"
#include "LevelSequenceEditor/Private/CinematicViewport/FilmOverlays.h"

...
void SMyLevelViewport::Construct(const FArguments& InArgs)
{
	ParentLayout = InArgs._ParentLayout;
	LayoutName = InArgs._LayoutName;
	RevertToLayoutName = InArgs._RevertToLayoutName;

	ViewportClient = MakeShareable(new FMyViewportClient());

	ViewportWidget = SNew(SMyPreviewViewport)
		.LevelEditorViewportClient(ViewportClient)
		.ParentLevelEditor(InArgs._ParentLevelEditor)
		.ParentLayout(ParentLayout.Pin())
		.ConfigKey(LayoutName)
		.Realtime(true);

	ViewportClient->SetViewportWidget(ViewportWidget);
	ViewportClient->SetGameView(true);
       ...
	TSharedRef<SFilmOverlayOptions> FilmOverlayOptions = SNew(SFilmOverlayOptions);
      ...
}

Is there something off in my setup? Any help would be appreciated!

SFilmOverlayOptions is not exported from the module, as it’s a private class. That makes it pretty much off limits.

Not sure what alternatives there are for what you’re doing, but that’s why you get the Unresolved External Symbol.

class SFilmOverlayOptions : public SCompoundWidget
{
public:

	/** Construct this widget */
	void Construct(const FArguments& InArgs);

(There’s no LEVELSEQUNCEEDITOR_API, above.)

This is an example of a class that’s exported from the module.

class LEVELSEQUENCEEDITOR_API ULevelSequenceEditorSubsystem : public UEditorSubsystem
2 Likes

Thanks for the reply. Since posting I came to realize what I’m attempting wasn’t possible. Appreciate the help!

1 Like