pratik
9th July 2007, 09:32
hello all
i have created three classes in qt 4.2...
say
a.h
b.h
c.h
and corres. source file
a.cpp
b.cpp
c.cpp
now i want to use the object of class which is declared in a.h and defined in a.cpp in b.cpp and c.cpp.............
the problem is if i declare it in a.h after the class declaration and then include a.h in both b.cpp and c.cpp then its giving the linker error.......
the error is multiple defination of class object................
please help as this the normal way of doing it in OOPS........
i have wraped all the .h files in the macro #ifndef #define #endif........
thanking all in anticipation
i have created three classes in qt 4.2...
say
a.h
b.h
c.h
and corres. source file
a.cpp
b.cpp
c.cpp
now i want to use the object of class which is declared in a.h and defined in a.cpp in b.cpp and c.cpp.............
the problem is if i declare it in a.h after the class declaration and then include a.h in both b.cpp and c.cpp then its giving the linker error.......
the error is multiple defination of class object................
please help as this the normal way of doing it in OOPS........
i have wraped all the .h files in the macro #ifndef #define #endif........
thanking all in anticipation