Ok...
My files are like this now:
testA.h
#ifndef __TESTA_H
#define __TESTA_H
#include <stdio.h>
#include "testB.h"
class TestA {
public:
TestA();
void testPrint();
void test();
void set(TestB* t);
int getID();
private:
int id;
TestB* b;
};
#endif
testB.h
#ifndef __TESTB_H
#define __TESTB_H
#include <stdio.h>
#include "testA.h"
class TestB {
public:
TestB();
void testPrint();
void test();
void set(TestA* t);
int getID();
private:
int id;
TestA* a;
};
#endif
On compiling g++ -Wall -c testA.C
testB.h:12: error: ‘TestA’ has not been declared
testB.h:17: error: ISO C++ forbids declaration of ‘TestA’ with no type
testB.h:17: error: expected ‘;’ before ‘*’ token
On compiling g++ -Wall -c testB.C
testA.h:12: error: ‘TestB’ has not been declared
testA.h:17: error: ISO C++ forbids declaration of ‘TestB’ with no type
testA.h:17: error: expected ‘;’ before ‘*’ token
Please help to fix this issue!!!