Unsupported x86-64 instruction set error when compiling C file

前端 未结 3 2269
清歌不尽
清歌不尽 2021-02-15 00:05

I am trying to follow the tutorials in this link.

When I get down to the part where I start making a test.c file, I try to run the first compilation line.



        
3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-15 00:30

    gcc -std=c99 -c -g -Os -march=i686 -m32 -ffreestanding -Wall -Werror test.c -o test.o
    ld -static -T test.ld -m elf_i386 -nostdlib --nmagic -o test.elf test.o
    

提交回复
热议问题