Unable to compile Protocol Buffers (protobuf) examples in MSVS 2022 on Windows 10

76 views
Skip to first unread message

Viktor Sokolov

unread,
Apr 3, 2022, 11:53:32 AM4/3/22
to Protocol Buffers
I'm trying to compile a protobuf example from here: https://developers.google.com/protocol-buffers/docs/cpptutorial.
My system configuration:
- Windows 10 Pro,
- Visual studion 2022 (Community Ed.) with C++ Package for Desktop Development,
- Protobuf v3.20.0 (Latest Version).
I've done the following steps:
1. Compiled protobuf from the source code, successfully ran tests, and got the *install* folder with the files: *bin*, *cmake*, *include*, *lib*
2. After generating .cpp and .h files using *protoc.exe*, I added them to the VS project and also included *libprotobuf.lib*.Then, I specified path to the *include* folder in the project properties -> VC++ Directories -> Include Directories.
3. While building console application in VS 2022, I was getting a lot of errors, which are in the log file I added to this message.

ErrorLog.txt

Viktor Sokolov

unread,
Apr 7, 2022, 5:03:43 AM4/7/22
to Protocol Buffers
The only solution I could find: instead of using MSVS compilator, I succesfully compiled protobuf with MinGW-w64 compiler for Windows.
Reply all
Reply to author
Forward
0 new messages