Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error: Not compiling when BUILD_GRPC_CLIENT is ON #158

Open
DronCode opened this issue Jun 3, 2024 · 1 comment
Open

Build error: Not compiling when BUILD_GRPC_CLIENT is ON #158

DronCode opened this issue Jun 3, 2024 · 1 comment

Comments

@DronCode
Copy link

DronCode commented Jun 3, 2024

Hi! I'm trying to build Nakama C++ SDK for UWP with gRPC support.
First of all: it requires gRPC dependency, but vcpkg.json does not contains "grpc" dependency, but it's fixable. (just added in local copy and it fix my issue)

Main issue: in core/core-grpc/GrpcClient.cpp used wrong variable (I tested 2.8.4 and v2.8.5 tags).

Current code:

GrpcClient::GrpcClient(const NClientParameters& parameters)
{
    NLOG(NLogLevel::Info, "Created. NakamaSdkVersion: %s", getNakamaSdkVersion());

    _host = parameters.host;
    _ssl = parameters.ssl;
    _platformParams = parameters.platformParams;

    _port = parameters.port;

    if (port == DEFAULT_PORT)
    {
        port = parameters.ssl ? 443 : 7349;
        NLOG(NLogLevel::Info, "using default port %d", port);
    }

    std::string target = parameters.host + ":" + std::to_string(port);

but port variable does not exists. I fixed it locally as

GrpcClient::GrpcClient(const NClientParameters& parameters)
{
    NLOG(NLogLevel::Info, "Created. NakamaSdkVersion: %s", getNakamaSdkVersion());

    _host = parameters.host;
    _ssl = parameters.ssl;
    _platformParams = parameters.platformParams;

    _port = parameters.port;

    if (_port == DEFAULT_PORT)
    {
        _port = parameters.ssl ? 443 : 7349;
        NLOG(NLogLevel::Info, "using default port %d", _port);
    }

    std::string target = parameters.host + ":" + std::to_string(_port);

Questions:

  • Is my fix ok?
  • Why grpc not included as dependency in vcpkg.json? How to fix that dependency properly? (I'm not familiar with vcpkg.json)
Copy link

linear bot commented Jun 3, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant