I’m trying to use the FAVIWriter object and I am able to create an instance of it, but when I attempt to access any methods I get linker errors.
Build.cs
PublicDependencyModuleNames.AddRange(new string[]{'Core", "AVIWriter"});
MediaCaptureBPLibrary.cpp
#include "AVIWriter/Public/AVIWriter.h"
void UMediaCaptureBPLibrary::MediaCaptureSampleFunction()
{
// This compiles
FAVIWriterOptions Options;
Options.Width = 320;
Options.Height = 240;
// This compiles
FAVIWriter *Writer = FAVIWriter::CreateInstance(Options);
// This results in linker errors
const TArray<FCapturedFrame> data = Writer->GetFrameData(1000);
}
Linker Errors
2>MediaCaptureBPLibrary.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl FCapturedFrame::~FCapturedFrame(void)" (??1FCapturedFrame@@QEAA@XZ) referenced in function "public: __cdecl TArray<struct FCapturedFrame,class TSizedDefaultAllocator<32> >::~TArray<struct FCapturedFrame,class TSizedDefaultAllocator<32> >(void)" (??1?$TArray@UFCapturedFrame@@anonymous_user_e71e0d8a?$TSizedDefaultAllocator@$0CA@@@@@QEAA@XZ)
2>MediaCaptureBPLibrary.cpp.obj : error LNK2019: unresolved external symbol "public: class TArray<struct FCapturedFrame,class TSizedDefaultAllocator<32> > __cdecl FCapturedFrames::ReadFrames(unsigned int)" (?ReadFrames@FCapturedFrames@@QEAA?AV?$TArray@UFCapturedFrame@@anonymous_user_e71e0d8a?$TSizedDefaultAllocator@$0CA@@@@@I@Z) referenced in function "public: class TArray<struct FCapturedFrame,class TSizedDefaultAllocator<32> > __cdecl FAVIWriter::GetFrameData(unsigned int)const " (?GetFrameData@FAVIWriter@@QEBA?AV?$TArray@UFCapturedFrame@@anonymous_user_e71e0d8a?$TSizedDefaultAllocator@$0CA@@@@@I@Z)
Why does the CreateInstance method compile, but the other methods give me a linker error even though everything is defined in the included header file? I also tried adding the header files to the public and private include paths.