Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22070

undefined reference to memset shown even though included string.h

$
0
0

I wrote GDT/IDT table loader for my own kernel, and I linked it with ld. But when I generate the binary, the error has appeared.ld.exe: desc_tablesc.o:desc_tables.c:(.text+0x1e7): undefined reference to `memcpy'

and here's my code:

#include "desc_tables.h"#include "common.h"#include <stdint.h>static void init_idt(){   __idt_ptr.limit = sizeof(idt_entry) * 256 -1;   __idt_ptr.base  = (u32int)&idt_entries;   memset(&idt_entries, 0, sizeof(idt_entry)*256);   idt_set_gate( 0, (u32int)isr0 , 0x08, 0x8E);   . . .   idt_set_gate( 31, (u32int)isr31, 0x08, 0x8E);   idt_flush((u32int)&__idt_ptr);}```

Viewing all articles
Browse latest Browse all 22070

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>