Target_link_libraries( server PRIVATE gRPC::grpc++ gRPC::grpc++_reflection gRPC::gpr gRPC::grpc gRPC::grpc++ gRPC::grpc_cronet protobuf::libprotoc protobuf::libprotobuf protobuf::libprotobuf-lite ) Include_directories(/buildtrees/protobuf/src/23fa7edd52-3ba2225d30.clean/src)Īdd_executable( server src/server.cpp proto/.cc proto/helloworld.pb.cc)Īdd_executable( client src/client.cpp proto/.cc proto/helloworld.pb.cc) Take the following code and copy it to our CMakeLists.txt file. Now let's add content to our CMakeLists.txt file. plugin=protoc-gen-grpc="\packages\grpc_圆4-windows\tools\grpc\grpc_cpp_plugin.exe". Now copy the file to our project/proto folder and run the following commands from there And it will be present in your \packages\protobuf_圆4-windows\tools\protobuf folder If protoc is not available from your console, you might have to add it to your system env PATH. Now we have everything we need, so let's try to generate the message and service interfaces from a proto file using the protoc compiler vcpkg install protobuf protobuf:圆4-windows.In order to install gRPC using vcpkg, launch a console in Windows and execute the following command, cid_service.protoĬopy files to VS project and add them to Header Files/Source Files plugin=protoc-gen-grpc=grpc_cpp_plugin.exe cid_service.proto Navigate to "C:\Users\aaron\repo\grpc\.build"Ĭopy grpc_cpp_plugin.exe to "C:\Program Files (x86)\grpc\bin" proto to "C:\Program Files (x86)\grpc\bin" RC Resource Files -> Add new -> Utility -> Text.txtĬopy. Set Precompiled Header = "Not Using Precompiled Headers" RC project -> Properties -> C/C++ -> Precompiled Headers Open visual studio and create new project Open Administrator: Command Prompt (shift+RC cmd and run as admin)Ĭall "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" 圆4Ĭmake. Microsoft Visual Studio Community 2017 Version 15.6.4Īdd C:\ProgramData\chocolatey\lib\yasm\tools to PATHĬlone grpc sources including submodules.Ĭmake: Using Ninja (supports boringssl's assembly optimizations). Here is the solution I used to install and use grpc on windows.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |