我在代码中收到了大量类似这样的错误。无法弄清楚原因。下面是错误的一个例子:预期'=',',',';','asm'或'__attribute__'在'{'标记之前
In file included from mipstomachine.c:2:0,
from assembler.c:4:
rtype.c: In function ‘getRegister’:
rtype.c:6:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
我的当前文件的布局,作为阐述,具有mipstomachine.c,其包括assembler.c,其包括rtype.c
这里是线4-6我rtype.c
void rToMachine(char* line, char* mach, int currentSpot, instr currentInstruction,
rcode* rcodes)
{
我得到这样的错误在rtype.c
任何想法宣称每一个功能?多谢你们!
消息说'rtype.c:In function'getRegister':',但是你没有显示相关的代码。你能提供更多的背景吗? – 2013-04-26 04:48:58
你缺少'}'一些在我猜测之前的那个函数。 – Jeyaram 2013-04-26 04:49:03
你有源文件,其中包含其他源文件?这不是真的推荐,我实际上会说它是边界错误的。将函数原型和结构放在头文件中,并在需要时将它们包含在源文件中,然后将源文件链接在一起。 – 2013-04-26 04:51:19