i write a kernel as "Writing a Kernel in C++"(http://www.invalidsoftware.net/os/?the_id=11),I do all the things exactly.
but the ld display a error message:
video.o: In function `Video::~Video(void)':
video.o(.text+0x33): undefined reference to `__builtin_delete'
why?
and what can i do to fix it?
thank you very much!
how can i write a C++ kernel?
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:how can i write a C++ kernel?
hum.
i'm surprised to see this error in conjunction with -fno-builtin.
maybe you're missing an operator delete() or something
i'm surprised to see this error in conjunction with -fno-builtin.
maybe you're missing an operator delete() or something
Re:how can i write a C++ kernel?
yes.
i did it only just as the start of that tutorial.
so i don't write operator delete();
but in that tutorial, it doesn't be used.
i must write it yet?
i did it only just as the start of that tutorial.
so i don't write operator delete();
but in that tutorial, it doesn't be used.
i must write it yet?
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:how can i write a C++ kernel?
it depends on where your video object is built, imho.
does not require any destructor as the object is permanent, while
will attempt to delete the screen when exitting main().
Code: Select all
Video screen;
main() {
screen.clear();
screen.text("Hello World");
}
Code: Select all
main() {
Video screen;
screen.clear();
screen.text("Hello World");
}
Re:how can i write a C++ kernel?
Exactly.
Either you create your Video object globally, or you have to supply operator new() and operator delete().
Since you are just starting, you probably don't have a memory management set up yet, so you should stick to the global Video object for now.
Either you create your Video object globally, or you have to supply operator new() and operator delete().
Since you are just starting, you probably don't have a memory management set up yet, so you should stick to the global Video object for now.
Every good solution is obvious once you've found it.