Build GameNetworkingSockets on Windows

Build

Install OpenSSL

Install cmake

Install ninja

Enable vcvarsall

  • Add C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC to Path

Build protobuf

  • https://github.com/protocolbuffers/protobuf/releases
  • Download protobuf cpp 3.11
  • Run VS2019 with Administrator
  • Open command line and goto the folder
    mkdir cmake_build
    cd cmake_build
    vcvarsall amd64
    cmake -G Ninja -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=c:\sdk\protobuf-amd64 ..\cmake
    ninja
    ninja install
    

Build GameNetworkingSockets

Test example_chat

Collect these files in a folder

  • GameNetworkingSocks dll files
  • example_chat.exe
  • protobuf dll files

Run Server

example_chat server

Run Client #1

example_chat client 127.0.0.1
/nick PlayerAAA
hi
How are you?
/quit

Run Client #2

example_chat client 127.0.0.1
/nick PlayerBBB
hello
Fine
/quit

Output would be following

example_chat client 127.0.0.1
/nick PlayerAAA
Ye shall henceforth be known as PlayerAAA
/nick PlayerBBB
Ye shall henceforth be known as PlayerBBB
PlayerAAA: hi
PlayerBBB: hello
PlayerAAA: How are you?
PlayerBBB: Fine
PlayerAAA departed
PlayerBBB departed
Written on December 7, 2019