Function defined twice? [SOLVED]
Posted: Sat Jun 21, 2025 5:05 pm
I am getting this error when running make, and am not sure where the other function definition is, as the only function definition for memset and vga_print I can see are in utils.c. Sorry if this is a really dumb question, but this is really confusing me
The error:
The project files: https://github.com/i-love-winter/SolsticeOS
The error:
Code: Select all
i386-elf-gcc -ffreestanding -m32 -g -c src/kernel/kernel.c -o build/kernel.o
In file included from src/kernel/gdt/gdt.c:3,
from src/kernel/kernel.c:4:
src/kernel/gdt/../utils/utils.c:4:6: error: redefinition of 'memset'
4 | void memset(void *dest, char val, uint32_t count) {
| ^~~~~~
In file included from src/kernel/kernel.c:3:
src/kernel/utils/utils.c:4:6: note: previous definition of 'memset' with type 'void(void *, char, uint32_t)' {aka 'void(void *, char, long unsigned int)'}
4 | void memset(void *dest, char val, uint32_t count) {
| ^~~~~~
src/kernel/gdt/../utils/utils.c:11:6: error: redefinition of 'vga_print'
11 | void vga_print(const char *str) {
| ^~~~~~~~~
src/kernel/utils/utils.c:11:6: note: previous definition of 'vga_print' with type 'void(const char *)'
11 | void vga_print(const char *str) {
| ^~~~~~~~~
make: *** [Makefile:21: kernel] Error 1