Architecture of i386 input file is incompatible with i386:x86-64

MEv2.0 picture MEv2.0 · Oct 5, 2013 · Viewed 59.7k times · Source

I'm trying to create a simple kernel using Ubuntu. In the terminal I typed

ld -Ttext 0x1000 -o kernel.bin loader.o main.o Video.o

But I got the following error message in return:

ld: i386 architecture of input file `loader.o' is incompatible with i386:x86-64 output
ld: warning: cannot find entry symbol _start; defaulting to 0000000000001000

Answer

Leandro Andrade picture Leandro Andrade · Jun 17, 2014

If want compile the file as 32 bits, you can use:

ld -m elf_i386 -s -o file file.o