Hi!
I'm working on a hobby OS. Almost every time I try to link my files I get a 'undefined reference to' error. As I've been trying to compile with different compilers, the errors generated by the linker changes. I have only been using different ports of the GNU compilers. I first started with GCC, then G++ and now MinGW. Currently, I just want to print a character on screen. The code is only in 9 lines and has worked with GCC, but it doesn't work with MinGW. As I'm developing a custom OS, I am developing everything from scratch. That means I'm not using any external libraries in my code.
Here's the code I'm currently trying to compile/link:
// main.cpp
int main(void)
{
char *vidMem = (char*)0xB8000;
vidMem[0] = 'A';
vidMem[1] = 0x7;
return 0;
}
I'm using Dev-Cpp together with MinGW.
The 'undefined reference to' that is generated when using MinGW is "undefined reference to '_alloca'" and "undefined reference to '__main'"