vxworks一个超级奇怪的错误(parse error before `char')
void tserver(int id) { if(debug){ useResource(10000,id);} char msgBuf[MAX_MSG_LEN]; if (msgQReceive(myMsgQId, msgBuf, MAX_MSG_LEN, WAIT_FOREVER) == ERROR) return ; printf("Message from client:\n%s\n", msgBuf); }
竟让会报错
ccsimpc -g -mpentium -ansi -fno-builtin -fno-defer-pop -I. -IC:\Tornado2.2\target\h\ -DCPU
=SIMNT -DTOOL_FAMILY=gnu -DTOOL=gnu -c ..\homework2.c
..\homework2.c: In function `tserver':
..\homework2.c:54: parse error before `char'
..\homework2.c:55: `msgBuf' undeclared (first use in this function)
..\homework2.c:55: (Each undeclared identifier is reported only once
..\homework2.c:55: for each function it appears in.)
make: *** [homework2.o] Error 0x1
void tserver(int id) { char msgBuf[MAX_MSG_LEN]; if(debug){ useResource(10000,id);} if (msgQReceive(myMsgQId, msgBuf, MAX_MSG_LEN, WAIT_FOREVER) == ERROR) return ; printf("Message from client:\n%s\n", msgBuf); }
ccsimpc -g -mpentium -ansi -fno-builtin -fno-defer-pop -I. -IC:\Tornado2.2\target\h\ -DCPU
=SIMNT -DTOOL_FAMILY=gnu -DTOOL=gnu -c ..\homework2.cDone.
哎,为什么呢?
作者:小菜鸟_yang
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。