Classes in C++

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
pskyboy

Classes in C++

Post 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
jrfritz

Re:Classes in C++

Post by jrfritz »

Well, you need to add C++ run-time support.

whyme_t has info about that.
pskyboy

Re:Classes in C++

Post 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
jrfritz

Re:Classes in C++

Post by jrfritz »

I'd like to see that file...maybe i'd help me....
pskyboy

Re:Classes in C++

Post by pskyboy »

Which files that the MemoryManager.cpp.

Do you mean how to get classes to compile or how to implement classes.

Peter
jrfritz

Re:Classes in C++

Post by jrfritz »

I want to see your code that lets you have classes.
pskyboy

Re:Classes in C++

Post 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
Post Reply