Multiple definition of, error "foo" indeclarated...
Posted: Sun Jan 27, 2019 8:00 pm
I'm restructuring my code, but when I compile I have a lot of errors, mostly from the linker;
Linker:
compiler:
But nl, LIGHTGRAY and RED macros exists!
Here's the code: https://gitlab.com/hextakatt/experimentalos
Linker:
Code: Select all
kernel/serial.o: In function `outb':
/mnt/c/Users/user/Desktop/osproject/kernel/kernel.h:47: multiple definition of `init_serial'
kmain.o:/mnt/c/Users/user/Desktop/osproject/kernel/kernel.h:58: first defined here
kernel/serial.o: In function `inb':
/mnt/c/Users/user/Desktop/osproject/kernel/kernel.h:54: multiple definition of `serial_received'
kmain.o:/mnt/c/Users/user/Desktop/osproject/kernel/kernel.h:65: first defined here
kernel/serial.o: In function `inb':
/mnt/c/Users/user/Desktop/osproject/kernel/kernel.h:54: multiple definition of `read_serial'
kmain.o:/mnt/c/Users/user/Desktop/osproject/kernel/kernel.h:65: first defined here
kernel/serial.o: In function `inb':
/mnt/c/Users/user/Desktop/osproject/kernel/kernel.h:54: multiple definition of `is_transmit_empty'
kmain.o:/mnt/c/Users/user/Desktop/osproject/kernel/kernel.h:65: first defined here
kernel/serial.o: In function `write_serial':
/mnt/c/Users/user/Desktop/osproject/kernel/serial.c:37: multiple definition of `write_serial'
kmain.o:/mnt/c/Users/user/Desktop/osproject/kernel/serial.h:40: first defined here
collect2: error: ld returned 1 exit status
Code: Select all
In file included from kmain.c:5:0:
kernel/isrs.h: In function ‘fault_handler’:
kernel/isrs.h:142:22: error: ‘LIGHTGRAY’ undeclared (first use in this function)
settextcolor(LIGHTGRAY, RED);
^
kernel/isrs.h:142:22: note: each undeclared identifier is reported only once for each function it appears in
kernel/isrs.h:142:33: error: ‘RED’ undeclared (first use in this function)
settextcolor(LIGHTGRAY, RED);
^
kmain.c: In function ‘kernelmain’:
kmain.c:24:38: error: expected ‘)’ before ‘nl’
println("asd ����� �"nl);
^
kmain.c:33:13: error: ‘nl’ undeclared (first use in this function)
println(nl);
^
Here's the code: https://gitlab.com/hextakatt/experimentalos