Closed danyeaw closed 1 year ago
@danyeaw My best guess is that your build is somehow mixing more than one version of the protobuf runtime library. For example, GOOGLE_ABSL_DCHECK_NE
is defined here in logging.h, but if the compiler is using an old version of that header then that definition won't be there. I think that would explain the other errors as well. Are there maybe some old protobuf headers lying around on your system somewhere?
Thanks @acozzette! I thought I had a clean build before when I was getting those errors, but I just wiped everything and started over, and now everything is building successfully. Thanks for the help, and apologies for opening an issue when one didn't really exist.
No worries, I'm glad you got it sorted out!
I am getting the following errors when trying to compile protobuf using CMake and Ninja with VS2022. This same setup works to compile version 3.15.8, but gives the following error on 3.21.12 or the latest main.
What version of protobuf and what language are you using? Version: main and 3.21.12 Language: C++
What operating system (Linux, Windows, ...) and version? Windows 11
What runtime / compiler are you using (e.g., python version or gcc version) Visual Studio 2022 using visualstudio2022-workload-vctools CLI
What did you do? Build flags for CMake are
-DCMAKE_BUILD_TYPE=Release -Dprotobuf_DEBUG_POSTFIX="" -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_WITH_ZLIB=ON -Dprotobuf_MSVC_STATIC_RUNTIME=OFF
What did you expect to see A successful build
What did you see instead? Build errors
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
Anything else we should know about your project / environment