I’m just getting my C++ Dev environment set up. I copied the code from the C++ Client Guide. Then I tried to create an instance of NakamaSessionManager in my Main function. And I’m getting a bunch of build errors. Can anybody help? I thought I followed the instructions.
"mismatch detected for ‘_ITERATOR_DEBUG_LEVEL’: value ‘0’ doesn’t match value ‘2’
#include <iostream>
#include "nakama-cpp/Nakama.h"
using namespace Nakama;
using namespace std;
class NakamaSessionManager
{
public:
NakamaSessionManager()
{
NClientParameters parameters;
_client = createDefaultClient(parameters);
}
void start(const string& deviceId)
{
// to do: read session token from your storage
string sessionToken;
if (!sessionToken.empty())
{
// Lets check if we can restore a cached session.
auto session = restoreSession(sessionToken);
if (!session->isExpired())
{
// Session was valid and is restored now.
_session = session;
return;
}
}
auto successCallback = [this](NSessionPtr session)
{
_session = session;
// to do: save session token in your storage
std::cout << "session token: " << session->getAuthToken() << std::endl;
};
auto errorCallback = [](const NError& error)
{
};
_client->authenticateDevice(deviceId, opt::nullopt, opt::nullopt, {}, successCallback, errorCallback);
}
protected:
NClientPtr _client;
NSessionPtr _session;
};
int main()
{
NakamaSessionManager MyClient; //calling the class exactly as in the example and failing in construction
std::cout << "Hello World!\n";
}