Skip to content

Latest commit

 

History

History
32 lines (31 loc) · 1.79 KB

install_protobuf_Win64_VS2017.md

File metadata and controls

32 lines (31 loc) · 1.79 KB

Install protobuf for Win64 and Visual Studio 2017

  1. Create and run Shell-Script (e.g. with cmd.exe):
    #!/bin/bash
    # Protobuf 3.14.0
    cd C:/tmp
    curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/protobuf-cpp-3.14.0.zip
    unzip -qq protobuf-cpp-3.14.0.zip
    cd protobuf-3.14.0/cmake
    mkdir -p build-dir && cd build-dir && rm -r *
    "C:/Program Files/CMake/bin/cmake.exe" \
        -G "Visual Studio 15 2017" \
        -DCMAKE_INSTALL_PREFIX:PATH=C:/protobuf-3.14 \
        -DCMAKE_SHARED_LINKER_FLAGS:STRING=/machine:x64 \
        -DCMAKE_STATIC_LINKER_FLAGS:STRING=/machine:x64 \
        -DCMAKE_EXE_LINKER_FLAGS:STRING=/machine:x64 \
        -DCMAKE_MODULE_LINKER_FLAGS:STRING=/machine:x64 \
        -DCMAKE_GENERATOR_PLATFORM:INTERNAL=x64 \
        -Dprotobuf_WITH_ZLIB:BOOL=OFF \
        -Dprotobuf_BUILD_TESTS:BOOL=OFF \
        ..
  2. Run extract_includes.bat located in build-dir from above
  3. Open protobuf.sln located in build-dir from above with Visual Studio 2017
  4. Change Properties->C/C++->Code Generation of all solutions for Configuration Release AND Debug
    • Runtime Library for Release must be set to "Multi-threaded DLL (/MD)":


    • Runtime Library for Debug must be set to "Multi-threaded Debug DLL (/MDd)":
  5. Build Solution for Release AND for Debug
  6. Build INSTALL for Release AND for Debug