i386输入文件的体系结构与i386:x86-64不兼容 [英] Architecture of i386 input file is incompatible with i386:x86-64

查看:1323
本文介绍了i386输入文件的体系结构与i386:x86-64不兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Ubuntu创建一个简单的内核.在终端中,键入

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

推荐答案

如果要将文件编译为32位,则可以使用:

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

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

这篇关于i386输入文件的体系结构与i386:x86-64不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆