colorful

zc qq:1337220912

 

使用proto 时犯的一个错误

自己定义的 #define CMD_ID_SERVER  1000

然后在proto文件里定义了
enum CMD_ID
{
      CMD_ID_SERVER = 20000;
}

得到下面的错误
Error    7    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int    e:\zc\test\doloio\package\hello\hello.pb.h    46
Error    9    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int    e:\zc\test\doloio\package\hello\hello.pb.h    46
Error    10    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int    e:\zc\test\doloio\package\hello\hello.pb.h    47
Error    13    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int    e:\zc\test\doloio\package\hello\hello.pb.h    47
Error    20    error C2447: '{' : missing function header (old-style formal list?)    e:\zc\test\doloio\package\hello\hello.pb.h    51
Error    27    error C2447: '{' : missing function header (old-style formal list?)    e:\zc\test\doloio\package\hello\hello.pb.h    431
Error    17    error C2440: 'initializing' : cannot convert from 'const int' to 'const std::string &'    e:\zc\test\doloio\package\hello\hello.pb.h    51
。。。。。。。。。。

------------------------------------------
其实根据错误信息应该很容易发现错误所在,但因为我心急,没能静下心来看错误信息以至浪费了更多的时间和精力于无谓的猜测试验


posted on 2012-05-22 18:00 多彩人生 阅读(817) 评论(1)  编辑 收藏 引用 所属分类: protobuf

评论

# re: 使用proto 时犯的一个错误 2012-05-22 21:02 钟谢伟

是呀,往往致命的错误都会是无意间犯下的小错误,写代码时还是得全神贯注的,心平气和的,呵呵  回复  更多评论   


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


导航

统计

常用链接

留言簿(3)

随笔分类

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜