怎么解决redefinition of "***"?
cr999 2003-09-03 07:06:41 有一小程序,在VC下编译通过,在DEV-C++下也通过,到linux下,在KDE2.0下死活不能编译通过。
主要是下面这个问题
a.h
#ifndef _A_H_
#define _A_H_
struct A
{
...
};
#endif
b.h
#include "a.h"
...
vector<A> v;
...
c.h
#include "a.h"
...
vector<A> v;
...
main.cpp
#include "c.h"
#include "b.h"
main()
...
错误是redefinition of "struct A";
但是如果将b.h中的“include a.h"拿掉,又有'A' was not declared in this scope.
请问如何解决~~