Using a FReadScopeLock with a FMultiReaderSingleWriterGT gives me a linker error:
error LNK2019: unresolved external symbol "public: void __cdecl FMultiReaderSingleWriterGT::LockRead(void)" (?LockRead@FMultiReaderSingleWriterGT@@QEAAXXZ) referenced in function "public: __cdecl FReadScopeLock::FReadScopeLock(class FMultiReaderSingleWriterGT *)" (??0FReadScopeLock@@QEAA@PEAVFMultiReaderSingleWriterGT@@@Z)
I am including the Core and CoreUObject modules in my build.cs file. Any idea of what might be happening?
I’m under Visual Studio 2015, UE 4.10.4, Launcher version.
Hey .cat-
Can you provide the code you’re using that is giving you errors? Additionally, did you add an include statement for the file path to the header for FMultiReaderSingleWriterGT (Runtime/Core/Public/HAL/ThreadingBase.h)? Lastly, I’m not able to find FReadScopedLock in the documentation. Can you explain where this data type is coming from?
First of all, sorry for my typo: the class is the FReadScopeLock ( https://docs.unrealengine.com/latest/INT/API/Runtime/Core/HAL/FReadScopeLock/index.html )
I just tested this creating a new Basic Code C++ project from within the editor, then created a new C++ class using the wizard.
This is the header file:
#pragma once
#include "GameFramework/Actor.h"
#include "Runtime/Core/Public/HAL/ThreadingBase.h"
#include "MyActor.generated.h"
UCLASS()
class MYPROJECT4_API AMyActor : public AActor
{
GENERATED_BODY()
public:
AMyActor();
virtual void BeginPlay() override;
virtual void Tick( float DeltaSeconds ) override;
private:
FMultiReaderSingleWriterGT mSyncObject;
};
while this is the .cpp:
#include "MyProject4.h"
#include "MyActor.h"
AMyActor::AMyActor()
{
PrimaryActorTick.bCanEverTick = true;
}
void AMyActor::BeginPlay()
{
Super::BeginPlay();
}
void AMyActor::Tick( float DeltaTime )
{
FReadScopeLock Lock(&mSyncObject);
Super::Tick( DeltaTime );
}
This is enough to reproduce the issue on my PC.
As a last note, I’d like to add that using a FScopeLock with a FCriticalSection compiles just fine.
Hey .cat-
I’ve entered a bug report for the unresolved external errors, UE-31222.
Cheers