pritamzope / OS

Writing & Making Operating System and Kernel parts so simple like Hello World Programs, Starting from writing Bootloaders, Hello World Kernel, GDT, IDT, Terminal, Keyboard/Mouse, Memory Manager, HDD ATA R/W, VGA/VESA Graphics
http://createyourownos.blogspot.com
663 stars 103 forks source link

TicTacToe: box.o:(.bss+0x0): multiple definition of `vga_buffer' #18

Closed arteze closed 3 years ago

arteze commented 3 years ago

At execute:

./run.sh

Result:

box.o:(.bss+0x0): multiple definition of `vga_buffer'
kernel.o:(.bss+0x4): first defined here
tic_tac_toe.o:(.bss+0x18): multiple definition of `vga_buffer'
kernel.o:(.bss+0x4): first defined here
grub-file: error: cannot open `TicTacToe.bin': No such file or directory.
cp: cannot stat 'TicTacToe.bin': No such file or directory

Versions:

arteze commented 3 years ago

The same happens in all projects, for example in Pong-Game.

/OS-master/Pong-Game# ./run.sh 
vga.o:(.bss+0x0): multiple definition of `vga_buffer'
kernel.o:(.bss+0x0): first defined here
bitmap.o:(.bss+0x0): multiple definition of `vga_buffer'
kernel.o:(.bss+0x0): first defined here
pong.o:(.bss+0x4): multiple definition of `vga_buffer'
kernel.o:(.bss+0x0): first defined here
xing1357 commented 3 years ago

try running the linker script with the params --allow-multiple-definition . I think he is declaring variables in the header files.

arteze commented 3 years ago

Thanks, it works for me.

I had seen that they use the parameter in the GCC with -Wl,--allow-multiple-definition, I never imagined that it would go in the linker (ld), it is good to know.

Screenshot(2)

xing1357 commented 3 years ago

Yeah, I hope he can update the header file.

arteze commented 3 years ago

Yes, I was able to compile it, as you can see in the image, it is running, and the issue can be closed but when I try to close it with Close with comment, it remains open.

xing1357 commented 3 years ago

I think @pritamzope should do that now.

pritamzope commented 3 years ago

issue fixed, please check