Error when Building Client with Unreal Plugin and Setup


Setting up a project and getting this error:

Here is my usage code for connecting/authenticating to the docker container I have running.

ASSPlayerController() : Super()
NClientParameters parameters;
parameters.serverKey = “defaultkey”; = “”;
parameters.port = 7350;
const NClientParameters& params = parameters;
NClientPtr client = createDefaultClient(NClientParameters());
this->NakamaClient = client;

NClientPtr NakamaClient;
virtual void Tick(float DeltaTime) override

	void StartSession()
	auto loginFailedCallback = [](const NError& error)
		GEngine->AddOnScreenDebugMessage(-1, 100, FColor::Red, *FString::Printf(TEXT("Session Auth Failed %s"), toString(error).c_str()));

	auto loginSucceededCallback = [](NSessionPtr session)
		GEngine->AddOnScreenDebugMessage(-1, 100, FColor::Green, TEXT("Session Auth Success on Callback"));

	std::string deviceId = "unique device id";


Any help is appreciated.

@blakemcclaren welcome :wave:

It looks like you aren’t passing the parameters object into createDefaultClient().

What if you change that line to:
NClientPtr client = createDefaultClient(parameters);

I recommend reading a bit about C++ constructors and passing references.

I have tried:

	NClientPtr client = createDefaultClient(NClientParameters());
	NClientPtr client = createDefaultClient(NClientParameters(paramters));
	NClientPtr client = createDefaultClient(NClientParameters(params));
	NClientPtr client = createDefaultClient(parameters);
	NClientPtr client = createDefaultClient(params);

All have the same error. I think its a library issue or something, but I will read up on constructors today. I am new and learning, so it could be anything.

Severity Code Description Project File Line Suppression State
Error C2664 ‘NakamaWrapper::NClientPtr NakamaWrapper::createDefaultClient(const NakamaWrapper::NClientParameters &)’: cannot convert argument 1 from ‘NClientParameters’ to ‘const NakamaWrapper::NClientParameters &’ soccersim L:\ue4games\soccersim\Source\soccersim\Public\SSPlayerController.h 30

Thanks for the response.