If I copy paste the “Full C++ Example” from the Client Guide and then try to start the Session Manager I get a bunch of Unresolved External Symbol Errors. They appear to be problems on objects within the Nakama libraries that I added to the linker. Can anybody advise? I would love to move forward with Nakama. Thanks!
#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 sessionManager;
sessionManager.start("mytestdevice0001");
}