yuanrongxi/revolver

用vs2013编译出错

Closed this issue · 1 comments

用vs2013编译源码(未修改),core工程报错,经过无数检查确认不存在语法错误

..\core\core_connection.cpp(163): error C3613: “->”后缺少返回类型(假定为“int”)
1>..\core\core_connection.cpp(163): error C3646: “add_tcp_packet”: 未知重写说明符
1>..\core\core_connection.cpp(163): error C3551: 如果使用尾随返回类型,则主要返回类型应该是单个类型说明符“自动”(而不是 "int")
1>..\core\core_connection.cpp(163): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>..\core\core_connection.cpp(163): error C2556: “int CSingletonBASEOBJECT::CoreThrottler::instance(void)”: 重载函数与“BASEOBJECT::CoreThrottler *CSingletonBASEOBJECT::CoreThrottler::instance(void)”只是在返回类型上不同
1> y:\myproject\rudp\revolver rudp\common\revolver\base_singleton.h(11): note: 参见“CSingletonBASEOBJECT::CoreThrottler::instance”的声明
1>..\core\core_connection.cpp(163): error C2040: “CSingletonBASEOBJECT::CoreThrottler::instance”:“int (void)”与“BASEOBJECT::CoreThrottler *(void)”的间接寻址级别不同
1>..\core\core_connection.cpp(163): error C2888: “BASEOBJECT::CoreThrottler *CSingletonBASEOBJECT::CoreThrottler::instance(void)”: 不能在命名空间“BASEOBJECT”内定义符号
1>..\core\core_connection.cpp(163): error C2059: 语法错误:“(”
1>..\core\core_connection.cpp(165): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>..\core\core_connection.cpp(167): error C2059: 语法错误:“if”
1>..\core\core_connection.cpp(168): error C2143: 语法错误: 缺少“;”(在“{”的前面)
1>..\core\core_connection.cpp(168): error C2447: “{”: 缺少函数标题(是否是老式的形式表?)
1>..\core\core_connection.cpp(187): error C2059: 语法错误:“if”
1>..\core\core_connection.cpp(187): error C2143: 语法错误: 缺少“;”(在“{”的前面)
1>..\core\core_connection.cpp(187): error C2447: “{”: 缺少函数标题(是否是老式的形式表?)
1>..\core\core_connection.cpp(189): error C2059: 语法错误:“return”
1>..\core\core_connection.cpp(193): error C2601: “BASEOBJECT::CConnection::send”: 本地函数定义是非法的
1>..\core\core_connection.cpp(212): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>..\core\core_connection.cpp(214): error C3613: “->”后缺少返回类型(假定为“int”)
1>..\core\core_connection.cpp(214): error C3646: “add_tcp_packet”: 未知重写说明符
1>..\core\core_connection.cpp(214): error C3551: 如果使用尾随返回类型,则主要返回类型应该是单个类型说明符“自动”(而不是 "int")
1>..\core\core_connection.cpp(214): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>..\core\core_connection.cpp(214): error C2556: “int CSingleton<BASEOBJECT

解决:用vs打开core_connection.cpp, 选择 文件->高级保存->编码格式选择GB2312 codepage936 点击保存就好了。