问题是这样的:
PacsDBConnection定义在PacsDBIF.h中
CTableList定义在TableNameListNode.h中
现在TableNameListNode.h已经#include "PacsDBIF.h"
如果我们PacsDBConnection要加入CTableList gTableList变量就需要在PacsDBIF.h中#include "TableNameListNode.h"
这样就造成了两个头文件相互include的问题。
我使用过#ifndef #define #endif和class声明两种方法都没有解决。
PacsDBConnection定义在PacsDBIF.h中
CTableList定义在TableNameListNode.h中
现在TableNameListNode.h已经#include "PacsDBIF.h"
如果我们PacsDBConnection要加入CTableList gTableList变量就需要在PacsDBIF.h中#include "TableNameListNode.h"
这样就造成了两个头文件相互include的问题。
我使用过#ifndef #define #endif和class声明两种方法都没有解决。
{
friend class CTableList;
public:
........
}
#include""
另一个class前用
class 另一个类名;
class PacsDBConnection
{
CTableList* m_pTableList;
}//PacsDBIF.cpp
#include "PacsDBIF.h"
#include "TableNameListNode.h"
...
m_pTableList=new CTableList;
...