// a.h
struct a_
{
int a;
};// b.h
#include "a.h"struct b_
{
int b;
struct a_ a[9];
};
编译出错:--------------------Configuration: test - Win32 Debug--------------------
Compiling...
test.cpp
F:\MyWork\test\test.cpp(9) : error C2079: 'b' uses undefined struct 'b_'
Error executing cl.exe.test.exe - 1 error(s), 0 warning(s)
//#include "stdafx.h"
struct b_ b;int main(int argc, char* argv[])
{
printf("Hello World!\n");
return 0;
}// stdafx.cpp : source file that includes just the standard includes
// test.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information#include "stdafx.h"// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
// a.h
struct a_
{
int a;
};// b.h
#include "a.h"struct b_
{
int b;
struct a_ a[9];
};// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//#if !defined(AFX_STDAFX_H__3FE23544_1E26_4DD8_9963_6F0B380B12F8__INCLUDED_)
#define AFX_STDAFX_H__3FE23544_1E26_4DD8_9963_6F0B380B12F8__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers#include <stdio.h>// TODO: reference additional headers your program requires here//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_STDAFX_H__3FE23544_1E26_4DD8_9963_6F0B380B12F8__INCLUDED_)