碰到这个问题,在一个简单的工程里面实现了重现。

定义一个结构,例如

// file MInfo.h

#pragma once
typedef struct MIMainInfo
{
	//HINSTANCE				m_hInstance;
	//HWND					m_hWnd;
	//HWND					hwndMB; 
	//应用是否启动
	int					m_bAppStart;

}MIMainInfo;

然后重定义一下,

// file pubdef.h

//#include "MInfo.h"
typedef struct 	MIMainInfo				MIMainInfo;

定义一个方法,

// file funtest.c

#include "pubdef.h"
//#include "MInfo.h"

void test1(MIMainInfo * mi)
{
	mi->m_bAppStart = -1;
	return;
}

编译上面三个文件,就会出现该错误。

 

解决方法其实很简单,就是将pubdef.h 文件里的包含文件反注释掉。

原因:funtest.c 文件里面并没有包含MIMainInfo结构的具体定义信息,只是包含了一个重定义变量以使编译并不出错。

相关文章:

  • 2021-12-27
  • 2021-04-14
  • 2021-05-26
  • 2022-12-23
  • 2021-11-12
  • 2022-12-23
  • 2022-01-19
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案