开发者

error compiling c code after updating mingw

Hello everyone today I updated mingw in my win64 environment but now I get an error in compiling that before the update the compiler didn't notify me..

this is the error:

a.h:9:39: error: expected ')' before '*' token
a.h:10:40: error: expected ')' before '*' token
a.h:11:34: error: expected ')' before '*' t开发者_如何学Coken

In this extern a.h file:

...
9:  extern void inserisciInPila(puntatore *testa, int x, int y);
10: extern void eliminaDallaPila(puntatore *testa);
11: extern void svuotaPila(puntatore *testa);
12: extern int **allocaLabirinto(int m, int n);
...

here it's the piece of code in another .h file that defines "puntatore" type

...
10: typedef struct pila{
11:     int x;
12:     int y;
13:     struct pila *prossimo;
14: } posizionePila;
15: typedef posizionePila *puntatore;
...

for example I show you the first function (inserisciInPila())

...
void inserisciInPila(puntatore *testa, int x, int y){
    puntatore temp;
    temp = malloc(sizeof(posizionePila));
    if(temp==NULL)
        return(NULL);

    temp->x = x;
    temp->y = y;
    temp->prossimo = *testa;
    *testa = temp;
}
...

may you help me please? thanks!


You need to make sure that the declaration of the type puntatore is seen by the compiler before attempting to use it as a function argument type.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜