C++代码迁移.方法实现一直说缺少类型

C++ code migration. Method implementation keeps saying missing type

本文关键字:类型 一直 实现 代码 迁移 方法 C++      更新时间:2023-10-16

我正在尝试将一些用旧版本的Visual Studio(VS 2006)编写的代码迁移到2015版本,但我偶然发现了多个文件中的错误。

#ifndef C_I3E_TYPE_ARRAY_H_
#define C_I3E_TYPE_ARRAY_H_
#include "C_I3E_Type.h"
class C_I3E_Type_Array:public C_I3E_Type   {
protected:
virtual void Read(FILE *p_Stream);
unsigned int m_High_Bound;}

这是关于读取方法的。

#include "StdAfx.h"
#include "C_I3E_Type_Array.h"
#include "C_I3E_File.h"
#include "C_I3E_Module.h"
C_I3E_Type_Array::Read(FILE *p_Stream){
unsigned int linked_type_index;
//Get the Type Index
linked_type_index = Read_Numeric_Format(p_Stream);
m_Linked_Type = m_Parent->Get_Type_ByIndex(linked_type_index);
//Get the High Bound value of the array
m_High_Bound = Read_Numeric_Format(p_Stream);}

它不断向我发送此错误:

严重性代码说明项目文件行抑制状态 错误 C4430 缺少类型说明符 - 假定为 int。注意:C++没有
支持默认的 MaskGen d:\temp\bll\maskgen_whole_wo_dll\maskgen_all_classes_enabled\maskgen\classes\c_i3e\C_I3E_Type_Array.h 9

该错误非常具有描述性,请考虑下面的行:

C_I3E_Type_Array::Read(FILE *p_Stream) {

在头文件中,有一个void。所以它应该是:

void C_I3E_Type_Array::Read(FILE *p_Stream) {
#include "C_I3E_File.h"

标题中。在 Read() 的定义之前添加 void