os-tutorial icon indicating copy to clipboard operation
os-tutorial copied to clipboard

Lesson 18 - Multiple Definition Error

Open RaamyPi opened this issue 4 years ago • 4 comments

Owing to the fact that idt and idt_reg were not declared as extern variables in idt.h, I encountered a couple of Multiple Definition Errors. I have made the same changes myself.

RaamyPi avatar Jul 21 '20 13:07 RaamyPi

Me too. But unfortunately this is an unmaintained repo so your PR won't be merged.

TLHorse avatar Jul 31 '20 10:07 TLHorse

Why does conditional compilation (ifndef define endif) not work?

gaoze1998 avatar Sep 06 '20 07:09 gaoze1998

I tested it and found that in the same scenario, clang would not report error, while GCC would

gaoze1998 avatar Sep 06 '20 07:09 gaoze1998

For some reason, when I declared these variables as 'extern' in the header file, the boot loader refused to load strings and all my global string arrays were just full of null pointers. Removing the definitions entirely from the header file and moving them into the source file fixed my issue.

atlant04 avatar Jul 25 '21 14:07 atlant04