const Descriptor *desc = DescriptorPool::generated_pool()->FindMessageTypeByName(msg_name);
assert(desc);

  上述示例代码,desc结果为空。最后在github找到答案

上面链接中给出的解答是

OK, finally I figured out that there is no black magic and it's just a linker problem, I compiled the proto sources into a static library, seems the linker automatically optimized out those objs not used when linking against the static library. I follow this thread and it fixes the problem

另外一个人提出的问题和得到的回答

Q:how to config on Visual Studio,when build a static library?

A:An alternative is to reference these protos types somewhere in your code so they don't get stripped by the linker.(意思就是在之前的代码中使用过这个proto)

google protobuf c++ 反射的更多相关文章

  1. google protobuf使用

    下载的是github上的:https://github.com/google/protobuf If you get the source from github, you need to gener ...

  2. google protobuf的原理和思路提炼

    之前其实已经用了5篇文章完整地分析了protobuf的原理.回过头去看,感觉一方面篇幅过大,另一方面过于追求细节和源码,对protobuf的初学者并不十分友好,因此这篇文章将会站在"了解.使 ...

  3. google protobuf安装与使用

    google protobuf是一个灵活的.高效的用于序列化数据的协议.相比较XML和JSON格式,protobuf更小.更快.更便捷.google protobuf是跨语言的,并且自带了一个编译器( ...

  4. VS2013编译google protobuf 出现问题error C3861: “min”:

    问题描述: 今天用vs2013编译protobuf 2.4.1 报错: 错误 3 error C3861: "max": 找不到标识符 f:\google\protobuf\pro ...

  5. google protobuf初体验

    最近在读别人代码的时候发现一个的东西,名字叫protobuf, 感觉挺好用的,写在这里,留个记录.那么什么是protobuf 呢?假如您在网上搜索,应该会得到类似这样的文字介绍: Google Pro ...

  6. Google protobuf proto文件编写规则

    转载自: http://blog.csdn.net/yi_ya/article/details/40404231 1. 简单介绍 protobuf文件:就是定义你要的消息(类似java中的类)和消息中 ...

  7. window下编译并使用google protobuf

    参考网址: http://my.oschina.net/chenleijava/blog/261263 http://www.ibm.com/developerworks/cn/linux/l-cn- ...

  8. GOOGLE PROTOBUF开发者指南

    原文地址:http://www.cppblog.com/liquidx/archive/2009/06/23/88366.html 译者: gashero 目录 1   概览 1.1   什么是pro ...

  9. google protobuf ios开发使用

    简介: protobuf 即 google protocol buffer 是一种数据封装格式协议: 比如其他经常用的xml,json等格式:protobuf的优势是效率高,同样的一份数据使用prot ...

随机推荐

  1. java常用容器简要性能分析(List。Map。Set)

    嗯,实习的时候看到这个,感觉蛮好,这里摘录学习,生活加油: 我曾经害怕别人嘲笑的目光,后来,发现他们的目光不会在我身上停留太久,人们更愿意把目光放在自己身上. 知乎上看到,讲给自己. List Lis ...

  2. wr720n v4 折腾笔记(四):安装inode客户端njitclient

    前记: 既然折腾到这里,那就不怕再折腾一下了,之前说过最终还是安装南浦月大神的固件,折腾了一圈,怎么不直接在官方界面上安装呢,这里给出直接安装的方法,就是修改固件头为wr720nv4. 0x01 修改 ...

  3. canvas.toDataURL()报错的解决方案全都在这了

    报错详尽信息 Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases ...

  4. C# 获取基类或者接口的所有继承类方法

    static class ReflectionHelper { public static IEnumerable<T> CreateAllInstancesOf<T>() { ...

  5. 使用Keras进行深度学习:(三)使用text-CNN处理自然语言(上)

    欢迎大家关注我们的网站和系列教程:http://www.tensorflownews.com/,学习更多的机器学习.深度学习的知识! 上一篇文章中一直围绕着CNN处理图像数据进行讲解,而CNN除了处理 ...

  6. 近期 github 机器学习热门项目 top5

    欢迎大家关注我们的网站和系列教程:http://panchuang.net/ ,学习更多的机器学习.深度学习的知识! 作者:Walker No1:NVIDIA's vid2vid Technique( ...

  7. Flume数据采集结合etcd作为配置中心在爬虫数据采集处理中的架构实践。

    Apache Flume是一个分布式的.可靠的.可用的系统,用于有效地收集. 聚合和将大量日志数据从许多不同的源移动到一个集中的数据存储,但是其本身是以本地properties作为配置的,配置无法做到 ...

  8. JS 剑指Offer(五) 二叉树的重建

    题目:输入某二叉树的前序遍历和中序遍历的结果,请重建该二叉树.假设输入的前序遍历和中序遍历的结果中都不含重复的数字. 题目分析:已知二叉树的前序和中序遍历,根据前序遍历和中序遍历的规则,前序遍历的第一 ...

  9. php源码的编译

    本片文章主要介绍windows下的php源码的编译. 1.1 编译环境 软件 环境 操作系统 Windows 7 专业版 32bit Visual studio 2012 专业版 PHP 5.5.2. ...

  10. CodeForces - 817B(分类讨论 + 排列组合)

    题目链接 思路如下 这一题是:最菜的队伍只有三个人组成,我们只需对排序后的数组的 前三个元素进行分类讨论即可: a[3] != a[2] && a[3] != ar[1] a[3] = ...