Page 1 of 1
Classes in C++
Posted: Sun Dec 08, 2002 12:04 pm
by pskyboy
Hey Guys
I have just moved my kernel to the next step by trying to use classes. The only problem is when i try and instatiate the class, i get linker errors when trying to compile.
The linker errors are all undefined reference to then a decorated name for the class.
Any Ideas
Peter
Re:Classes in C++
Posted: Sun Dec 08, 2002 12:06 pm
by jrfritz
Well, you need to add C++ run-time support.
whyme_t has info about that.
Re:Classes in C++
Posted: Sun Dec 08, 2002 12:18 pm
by pskyboy
LOL, Its amazing how you can overlook the simple things when you get wrapped up in testing your kernel.
I had forgot to compile the MemoryManger.cpp and add it to the list to be linked, whoops oh well.
Peter
Re:Classes in C++
Posted: Sun Dec 08, 2002 3:43 pm
by jrfritz
I'd like to see that file...maybe i'd help me....
Re:Classes in C++
Posted: Mon Dec 09, 2002 11:38 am
by pskyboy
Which files that the MemoryManager.cpp.
Do you mean how to get classes to compile or how to implement classes.
Peter
Re:Classes in C++
Posted: Mon Dec 09, 2002 1:33 pm
by jrfritz
I want to see your code that lets you have classes.
Re:Classes in C++
Posted: Tue Dec 10, 2002 12:58 pm
by pskyboy
To have classes is easy just define your class, make sure you include it wherever you instantiate it. Then instantiate it and it will work. As long as you don't instansiate it on the freememory or whatever its called ie using new it will work.
Peter