How to make parts of my OS in C++ and the rest in C
How to make parts of my OS in C++ and the rest in C
I already have my low level parts of my OS in C and will make everything lowlevel in C because its easier but I want to make some parts of my OS in C++. Well what do I need for C++ to work fully
Re: How to make parts of my OS in C++ and the rest in C
I am not sure but I think that you sould try it:
1. Compile C code to, for example, file ccode.o
2. Compile C++ code to, for example, file cppcode.o
3. Using LD link files ccode.o and cppcode.o
You can compile both C code and C++ code using gcc.
1. Compile C code to, for example, file ccode.o
2. Compile C++ code to, for example, file cppcode.o
3. Using LD link files ccode.o and cppcode.o
You can compile both C code and C++ code using gcc.
-
- Member
- Posts: 144
- Joined: Tue Oct 26, 2004 11:00 pm
- Location: Australia
Re: How to make parts of my OS in C++ and the rest in C
To use C++ code in your kernel you will need to build some support code, namely the code which initialises the contructors for the global objects in your kernel. Oh, and try to avoid run-time-typing of variables, though inheritance is still allowed.
Two things are infinite: The universe and human stupidity. But I'm not quite sure about the universe.
--- Albert Einstein
--- Albert Einstein