OS-Reference
OS-Reference copied to clipboard
Fix GCC not compiling .c files, but .cpp
Problem: GCC won't compile the kernel unless its code is placed in a .cpp file
From OSDev Wiki:
"Writing a kernel in C++ is easy. Note that not all features from the language is available. For instance, exception support requires special runtime support and so does memory allocation. To write a kernel in C++, simply adopt code above: Add an extern "C" declaration to the main method."
Solution: Remove extern "C" from void main in kernel.cpp, and rename the file to kernel.c