hi,
i've got class "zespolona" and class "numer" in separated folders. their definitions are:
---------------------------------------
#ifndef _NUMER_H
#define _NUMER_H
#include <iostream>
using namespace std;
#include "zespolona.h"
//void plakietka(numer);
class zespolona;
class numer {
//double n;
std::string opis;
friend void plakietka(numer);
friend zespolona::zespolona(numer); //zaprzyjazniony konstruktor konwertujacy numer na zespolona
public:
double n;
numer(int k, std::string t="bez opisu"): n(k), opis(t){};
//numer(const numer& orig);
//virtual ~numer();
operator double(){return n;};
private:
};
#endif /* _NUMER_H */
--------------------------------------------------------------
#ifndef _ZESPOLONA_H
#define _ZESPOLONA_H
#include "numer.h"
class numer; //deklaracja zapowiadajaca
class zespolona {
double real;
double im;
public:
zespolona(double r=0, double i=0): real(r), im(i){};
//zespolona(const zespolona& orig); //copy constructor
zespolona (numer ob);///to musi byc friend w klasie numer, zeby zespolona mogla korzystac z jego skladnikow private
operator numer();
operator double();
void pokaz();
zespolona dodaj(zespolona a, zespolona b);
};
zespolona::zespolona (numer ob){
real=ob.n;
im=0;
}
#endif /* _ZESPOLONA_H */
--------------------------------------------------------
the problem is, that when compiling this i get error:
mkdir -p build/Debug/SunStudio-Solaris-Sparc
CC -c -g -o build/Debug/SunStudio-Solaris-Sparc/numer.o numer.cpp
"zespolona.h", line 25: Error: The type "numer" is incomplete.
1 Error(s) detected.
what should i change to avoid this error? why numer is incomplete?