我在代碼中收到了大量類似這樣的錯誤。無法弄清楚原因。下面是錯誤的一個例子:預期'=',',',';','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