You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

mrdaniel

Beginner

  • "mrdaniel" started this thread

Posts: 1

Location: singapore

Occupation: software architect

  • Send private message

1

Thursday, December 15th 2005, 2:50pm

class in another file undeclare

i'd several class files like classA in classA.cpp and classB in classB.cpp also there are related header files like classA.h and classB.h

As in classA.cpp code to reference classB, the compiler gave the undeclared message.

an extract from classA.cpp is :-

#include classB.h

classB *clsB = new ClassA();

that line alone was the compiler to give the undeclare error message.

please advise what was wrong or need to be done in the kDevelop.

thanks
mrDaniel

bram85

Professional

Posts: 948

Location: Eindhoven

Occupation: Software Engineer

  • Send private message

2

Friday, December 16th 2005, 11:25am

RE: class in another file undeclare

This is not really the right place to ask such questions. You'd better find a forum which answers C++ related questions.

Regarding your error: you include classB.h (faulty, it requires some quotes) while you call ClassA(). Which will probably in classA.h . And is classA inherited from classB ?
Bram Schoenmakers
KDE Netherlands (www.kde.nl)