- 下载protobuf源码
- CMake设置source code路径 protobuf-3.11.4\protobuf\cmake
- 指定mingw编译器的gcc和g++路径
- 点击configure,这一步会出错,需要指定CMAKE_MAKE_PROGRAM的路径:mingw32-make.exe
再次点击,
CMake Error at tests.cmake:2 (message):
Cannot find third_party/googletest directory that's needed to build tests.
If you use git, make sure you have cloned submodules:
git submodule update --init --recursive
If instead you want to skip tests, run cmake with:
cmake -Dprotobuf_BUILD_TESTS=OFF
这里如果third_party目录缺少test代码,这里如果不需要test的话,编译选项去掉protobuf_BUILD_TESTS
- mingw32-make
- mingw32-make install
网友评论