小编Jac*_*fer的帖子

无法编译C代码:错误:在“ int”之前应预期为“ =”,“,”,“;”,“ asm”或“ __attribute__”

我正在使用James M教程编写内核。我在带有GCC 6.2.0和Binutils的macOS 10.12上使用elf-i386拱的交叉编译器编写代码。

除以外 main.c,所有程序都会编译,但会因以下错误而失败:

错误:在'int'之前应为'=',',',';','asm'或'__attribute__'

但是,该文件与教程中的文件完全相同。谁能帮我找出原因?

/*
Sierra Kernel
kernel.c -- Main kernel file
Copyright (C) 2017  Jacobo Soffer <sofferjacob@gmail.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but …
Run Code Online (Sandbox Code Playgroud)

c gcc

5
推荐指数
2
解决办法
2万
查看次数

标签 统计

c ×1

gcc ×1