实例介绍
使用QT5.6.0自带的MinGW编译器利用CMake工具编译生成了可用的protobuf3.3.0的静态库文件(.a文件),可在QT windows中使用,还生成了protoc.exe可用来将.proto文件编译生成相应的.cpp和.h文件
【实例截图】
【核心代码】
4744302542896366259.rar
└── output330
├── CMakeCache.txt
├── CMakeFiles
│ ├── 3.11.0-rc1
│ │ ├── CMakeCCompiler.cmake
│ │ ├── CMakeCXXCompiler.cmake
│ │ ├── CMakeDetermineCompilerABI_C.bin
│ │ ├── CMakeDetermineCompilerABI_CXX.bin
│ │ ├── CMakeRCCompiler.cmake
│ │ ├── CMakeSystem.cmake
│ │ ├── CompilerIdC
│ │ │ ├── a.exe
│ │ │ ├── CMakeCCompilerId.c
│ │ │ └── tmp
│ │ └── CompilerIdCXX
│ │ ├── a.exe
│ │ ├── CMakeCXXCompilerId.cpp
│ │ └── tmp
│ ├── cmake.check_cache
│ ├── CMakeDirectoryInformation.cmake
│ ├── CMakeOutput.log
│ ├── CMakeRuleHashes.txt
│ ├── CMakeTmp
│ ├── Export
│ │ └── lib
│ │ └── cmake
│ │ └── protobuf
│ │ ├── protobuf-targets.cmake
│ │ └── protobuf-targets-noconfig.cmake
│ ├── feature_tests.bin
│ ├── feature_tests.c
│ ├── feature_tests.cxx
│ ├── js_embed.dir
│ │ ├── build.make
│ │ ├── cmake_clean.cmake
│ │ ├── CXX.includecache
│ │ ├── D_
│ │ │ └── protobuf-cpp-3.3.0
│ │ │ └── protobuf-3.3.0
│ │ │ └── src
│ │ │ └── protobuf
│ │ │ └── compiler
│ │ │ └── js
│ │ │ └── embed.cc.obj
│ │ ├── DependInfo.cmake
│ │ ├── depend.internal
│ │ ├── depend.make
│ │ ├── flags.make
│ │ ├── includes_CXX.rsp
│ │ ├── linklibs.rsp
│ │ ├── link.txt
│ │ ├── objects1.rsp
│ │ ├── objects.a
│ │ └── progress.make
│ ├── libprotobuf.dir
│ │ ├── build.make
│ │ ├── cmake_clean.cmake
│ │ ├── cmake_clean_target.cmake
│ │ ├── CXX.includecache
│ │ ├── D_
│ │ │ └── protobuf-cpp-3.3.0
│ │ │ └── protobuf-3.3.0
│ │ │ └── src
│ │ │ └── protobuf
│ │ │ ├── any.cc.obj
│ │ │ ├── any.pb.cc.obj
│ │ │ ├── api.pb.cc.obj
│ │ │ ├── arena.cc.obj
│ │ │ ├── arenastring.cc.obj
│ │ │ ├── compiler
│ │ │ │ ├── importer.cc.obj
│ │ │ │ └── parser.cc.obj
│ │ │ ├── descriptor.cc.obj
│ │ │ ├── descriptor_database.cc.obj
│ │ │ ├── descriptor.pb.cc.obj
│ │ │ ├── duration.pb.cc.obj
│ │ │ ├── dynamic_message.cc.obj
│ │ │ ├── empty.pb.cc.obj
│ │ │ ├── extension_set.cc.obj
│ │ │ ├── extension_set_heavy.cc.obj
│ │ │ ├── field_mask.pb.cc.obj
│ │ │ ├── generated_message_reflection.cc.obj
│ │ │ ├── generated_message_table_driven.cc.obj
│ │ │ ├── generated_message_util.cc.obj
│ │ │ ├── io
│ │ │ │ ├── coded_stream.cc.obj
│ │ │ │ ├── gzip_stream.cc.obj
│ │ │ │ ├── printer.cc.obj
│ │ │ │ ├── strtod.cc.obj
│ │ │ │ ├── tokenizer.cc.obj
│ │ │ │ ├── zero_copy_stream.cc.obj
│ │ │ │ ├── zero_copy_stream_impl.cc.obj
│ │ │ │ └── zero_copy_stream_impl_lite.cc.obj
│ │ │ ├── map_field.cc.obj
│ │ │ ├── message.cc.obj
│ │ │ ├── message_lite.cc.obj
│ │ │ ├── reflection_ops.cc.obj
│ │ │ ├── repeated_field.cc.obj
│ │ │ ├── service.cc.obj
│ │ │ ├── source_context.pb.cc.obj
│ │ │ ├── struct.pb.cc.obj
│ │ │ ├── stubs
│ │ │ │ ├── atomicops_internals_x86_gcc.cc.obj
│ │ │ │ ├── atomicops_internals_x86_msvc.cc.obj
│ │ │ │ ├── bytestream.cc.obj
│ │ │ │ ├── common.cc.obj
│ │ │ │ ├── int128.cc.obj
│ │ │ │ ├── mathlimits.cc.obj
│ │ │ │ ├── once.cc.obj
│ │ │ │ ├── status.cc.obj
│ │ │ │ ├── statusor.cc.obj
│ │ │ │ ├── stringpiece.cc.obj
│ │ │ │ ├── stringprintf.cc.obj
│ │ │ │ ├── structurally_valid.cc.obj
│ │ │ │ ├── strutil.cc.obj
│ │ │ │ ├── substitute.cc.obj
│ │ │ │ └── time.cc.obj
│ │ │ ├── text_format.cc.obj
│ │ │ ├── timestamp.pb.cc.obj
│ │ │ ├── type.pb.cc.obj
│ │ │ ├── unknown_field_set.cc.obj
│ │ │ ├── util
│ │ │ │ ├── delimited_message_util.cc.obj
│ │ │ │ ├── field_comparator.cc.obj
│ │ │ │ ├── field_mask_util.cc.obj
│ │ │ │ ├── internal
│ │ │ │ │ ├── datapiece.cc.obj
│ │ │ │ │ ├── default_value_objectwriter.cc.obj
│ │ │ │ │ ├── error_listener.cc.obj
│ │ │ │ │ ├── field_mask_utility.cc.obj
│ │ │ │ │ ├── json_escaping.cc.obj
│ │ │ │ │ ├── json_objectwriter.cc.obj
│ │ │ │ │ ├── json_stream_parser.cc.obj
│ │ │ │ │ ├── object_writer.cc.obj
│ │ │ │ │ ├── protostream_objectsource.cc.obj
│ │ │ │ │ ├── protostream_objectwriter.cc.obj
│ │ │ │ │ ├── proto_writer.cc.obj
│ │ │ │ │ ├── type_info.cc.obj
│ │ │ │ │ ├── type_info_test_helper.cc.obj
│ │ │ │ │ └── utility.cc.obj
│ │ │ │ ├── json_util.cc.obj
│ │ │ │ ├── message_differencer.cc.obj
│ │ │ │ ├── time_util.cc.obj
│ │ │ │ └── type_resolver_util.cc.obj
│ │ │ ├── wire_format.cc.obj
│ │ │ ├── wire_format_lite.cc.obj
│ │ │ └── wrappers.pb.cc.obj
│ │ ├── DependInfo.cmake
│ │ ├── depend.internal
│ │ ├── depend.make
│ │ ├── flags.make
│ │ ├── includes_CXX.rsp
│ │ ├── link.txt
│ │ └── progress.make
│ ├── libprotobuf-lite.dir
│ │ ├── build.make
│ │ ├── cmake_clean.cmake
│ │ ├── cmake_clean_target.cmake
│ │ ├── CXX.includecache
│ │ ├── D_
│ │ │ └── protobuf-cpp-3.3.0
│ │ │ └── protobuf-3.3.0
│ │ │ └── src
│ │ │ └── protobuf
│ │ │ ├── arena.cc.obj
│ │ │ ├── arenastring.cc.obj
│ │ │ ├── extension_set.cc.obj
│ │ │ ├── generated_message_util.cc.obj
│ │ │ ├── io
│ │ │ │ ├── coded_stream.cc.obj
│ │ │ │ ├── zero_copy_stream.cc.obj
│ │ │ │ └── zero_copy_stream_impl_lite.cc.obj
│ │ │ ├── message_lite.cc.obj
│ │ │ ├── repeated_field.cc.obj
│ │ │ ├── stubs
│ │ │ │ ├── atomicops_internals_x86_gcc.cc.obj
│ │ │ │ ├── atomicops_internals_x86_msvc.cc.obj
│ │ │ │ ├── bytestream.cc.obj
│ │ │ │ ├── common.cc.obj
│ │ │ │ ├── int128.cc.obj
│ │ │ │ ├── once.cc.obj
│ │ │ │ ├── status.cc.obj
│ │ │ │ ├── statusor.cc.obj
│ │ │ │ ├── stringpiece.cc.obj
│ │ │ │ ├── stringprintf.cc.obj
│ │ │ │ ├── structurally_valid.cc.obj
│ │ │ │ ├── strutil.cc.obj
│ │ │ │ └── time.cc.obj
│ │ │ └── wire_format_lite.cc.obj
│ │ ├── DependInfo.cmake
│ │ ├── depend.internal
│ │ ├── depend.make
│ │ ├── flags.make
│ │ ├── includes_CXX.rsp
│ │ ├── link.txt
│ │ └── progress.make
│ ├── libprotoc.dir
│ │ ├── build.make
│ │ ├── cmake_clean.cmake
│ │ ├── cmake_clean_target.cmake
│ │ ├── CXX.includecache
│ │ ├── D_
│ │ │ └── protobuf-cpp-3.3.0
│ │ │ └── protobuf-3.3.0
│ │ │ └── src
│ │ │ └── protobuf
│ │ │ └── compiler
│ │ │ ├── code_generator.cc.obj
│ │ │ ├── command_line_interface.cc.obj
│ │ │ ├── cpp
│ │ │ │ ├── cpp_enum.cc.obj
│ │ │ │ ├── cpp_enum_field.cc.obj
│ │ │ │ ├── cpp_extension.cc.obj
│ │ │ │ ├── cpp_field.cc.obj
│ │ │ │ ├── cpp_file.cc.obj
│ │ │ │ ├── cpp_generator.cc.obj
│ │ │ │ ├── cpp_helpers.cc.obj
│ │ │ │ ├── cpp_map_field.cc.obj
│ │ │ │ ├── cpp_message.cc.obj
│ │ │ │ ├── cpp_message_field.cc.obj
│ │ │ │ ├── cpp_primitive_field.cc.obj
│ │ │ │ ├── cpp_service.cc.obj
│ │ │ │ └── cpp_string_field.cc.obj
│ │ │ ├── csharp
│ │ │ │ ├── csharp_doc_comment.cc.obj
│ │ │ │ ├── csharp_enum.cc.obj
│ │ │ │ ├── csharp_enum_field.cc.obj
│ │ │ │ ├── csharp_field_base.cc.obj
│ │ │ │ ├── csharp_generator.cc.obj
│ │ │ │ ├── csharp_helpers.cc.obj
│ │ │ │ ├── csharp_map_field.cc.obj
│ │ │ │ ├── csharp_message.cc.obj
│ │ │ │ ├── csharp_message_field.cc.obj
│ │ │ │ ├── csharp_primitive_field.cc.obj
│ │ │ │ ├── csharp_reflection_class.cc.obj
│ │ │ │ ├── csharp_repeated_enum_field.cc.obj
│ │ │ │ ├── csharp_repeated_message_field.cc.obj
│ │ │ │ ├── csharp_repeated_primitive_field.cc.obj
│ │ │ │ ├── csharp_source_generator_base.cc.obj
│ │ │ │ └── csharp_wrapper_field.cc.obj
│ │ │ ├── java
│ │ │ │ ├── java_context.cc.obj
│ │ │ │ ├── java_doc_comment.cc.obj
│ │ │ │ ├── java_enum.cc.obj
│ │ │ │ ├── java_enum_field.cc.obj
│ │ │ │ ├── java_enum_field_lite.cc.obj
│ │ │ │ ├── java_enum_lite.cc.obj
│ │ │ │ ├── java_extension.cc.obj
│ │ │ │ ├── java_extension_lite.cc.obj
│ │ │ │ ├── java_field.cc.obj
│ │ │ │ ├── java_file.cc.obj
│ │ │ │ ├── java_generator.cc.obj
│ │ │ │ ├── java_generator_factory.cc.obj
│ │ │ │ ├── java_helpers.cc.obj
│ │ │ │ ├── java_lazy_message_field.cc.obj
│ │ │ │ ├── java_lazy_message_field_lite.cc.obj
│ │ │ │ ├── java_map_field.cc.obj
│ │ │ │ ├── java_map_field_lite.cc.obj
│ │ │ │ ├── java_message_builder.cc.obj
│ │ │ │ ├── java_message_builder_lite.cc.obj
│ │ │ │ ├── java_message.cc.obj
│ │ │ │ ├── java_message_field.cc.obj
│ │ │ │ ├── java_message_field_lite.cc.obj
│ │ │ │ ├── java_message_lite.cc.obj
│ │ │ │ ├── java_name_resolver.cc.obj
│ │ │ │ ├── java_primitive_field.cc.obj
│ │ │ │ ├── java_primitive_field_lite.cc.obj
│ │ │ │ ├── java_service.cc.obj
│ │ │ │ ├── java_shared_code_generator.cc.obj
│ │ │ │ ├── java_string_field.cc.obj
│ │ │ │ └── java_string_field_lite.cc.obj
│ │ │ ├── javanano
│ │ │ │ ├── javanano_enum.cc.obj
│ │ │ │ ├── javanano_enum_field.cc.obj
│ │ │ │ ├── javanano_extension.cc.obj
│ │ │ │ ├── javanano_field.cc.obj
│ │ │ │ ├── javanano_file.cc.obj
│ │ │ │ ├── javanano_generator.cc.obj
│ │ │ │ ├── javanano_helpers.cc.obj
│ │ │ │ ├── javanano_map_field.cc.obj
│ │ │ │ ├── javanano_message.cc.obj
│ │ │ │ ├── javanano_message_field.cc.obj
│ │ │ │ └── javanano_primitive_field.cc.obj
│ │ │ ├── js
│ │ │ │ ├── js_generator.cc.obj
│ │ │ │ └── well_known_types_embed.cc.obj
│ │ │ ├── objectivec
│ │ │ │ ├── objectivec_enum.cc.obj
│ │ │ │ ├── objectivec_enum_field.cc.obj
│ │ │ │ ├── objectivec_extension.cc.obj
│ │ │ │ ├── objectivec_field.cc.obj
│ │ │ │ ├── objectivec_file.cc.obj
│ │ │ │ ├── objectivec_generator.cc.obj
│ │ │ │ ├── objectivec_helpers.cc.obj
│ │ │ │ ├── objectivec_map_field.cc.obj
│ │ │ │ ├── objectivec_message.cc.obj
│ │ │ │ ├── objectivec_message_field.cc.obj
│ │ │ │ ├── objectivec_oneof.cc.obj
│ │ │ │ └── objectivec_primitive_field.cc.obj
│ │ │ ├── php
│ │ │ │ └── php_generator.cc.obj
│ │ │ ├── plugin.cc.obj
│ │ │ ├── plugin.pb.cc.obj
│ │ │ ├── profile.pb.cc.obj
│ │ │ ├── python
│ │ │ │ └── python_generator.cc.obj
│ │ │ ├── ruby
│ │ │ │ └── ruby_generator.cc.obj
│ │ │ ├── subprocess.cc.obj
│ │ │ └── zip_writer.cc.obj
│ │ ├── DependInfo.cmake
│ │ ├── depend.internal
│ │ ├── depend.make
│ │ ├── flags.make
│ │ ├── includes_CXX.rsp
│ │ ├── link.txt
│ │ └── progress.make
│ ├── Makefile2
│ ├── Makefile.cmake
│ ├── progress.marks
│ ├── protoc.dir
│ │ ├── build.make
│ │ ├── cmake_clean.cmake
│ │ ├── CXX.includecache
│ │ ├── D_
│ │ │ └── protobuf-cpp-3.3.0
│ │ │ └── protobuf-3.3.0
│ │ │ └── src
│ │ │ └── protobuf
│ │ │ └── compiler
│ │ │ └── main.cc.obj
│ │ ├── DependInfo.cmake
│ │ ├── depend.internal
│ │ ├── depend.make
│ │ ├── flags.make
│ │ ├── includes_CXX.rsp
│ │ ├── linklibs.rsp
│ │ ├── link.txt
│ │ ├── objects1.rsp
│ │ ├── objects.a
│ │ └── progress.make
│ └── TargetDirectories.txt
├── cmake_install.cmake
├── js_embed.exe
├── lib
│ └── cmake
│ └── protobuf
│ ├── protobuf-config.cmake
│ ├── protobuf-config-version.cmake
│ ├── protobuf-module.cmake
│ ├── protobuf-options.cmake
│ └── protobuf-targets.cmake
├── libprotobuf.a
├── libprotobuf-lite.a
├── libprotoc.a
├── Makefile
└── protoc.exe
70 directories, 292 files
标签:
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论