Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22216

In c programming language, i keep getting this error [duplicate]

$
0
0

Using gcc as a compiler, i always get this "error":

C:\Users\Miguel\AppData\Local\Temp\ccyRGBTU.o:EscapaManin.c:(.text+0x111): undefined reference to `lemapa'C:\Users\Miguel\AppData\Local\Temp\ccyRGBTU.o:EscapaManin.c:(.text+0x12d): undefined reference to `encontramapa'C:\Users\Miguel\AppData\Local\Temp\ccyRGBTU.o:EscapaManin.c:(.text+0x139): undefined reference to `imprimemapa'C:\Users\Miguel\AppData\Local\Temp\ccyRGBTU.o:EscapaManin.c:(.text+0x172): undefined reference to `liberamapa'collect2.exe: error: ld returned 1 exit status

What should i do?

This was my code:

#include <stdio.h>#include <stdlib.h>#include "Functions.h"MAPA m;POSICAO heroi;int acabou() {    return 0;}void move(char direcao) {    if(        direcao != 'a'&&         direcao != 'w'&&        direcao != 's'&&        direcao != 'd'    ) return;    int proximox = heroi.x;    int proximoy = heroi.y;    switch(direcao) {        case 'a':            proximoy--;            break;        case 'w':            proximox--;            break;        case 's':            proximox++;            break;        case 'd':            proximoy++;            break;    }    if(proximox >= m.linhas)         return;    if(proximoy >= m.colunas)         return;    if(m.matriz[proximox][proximoy] != '.')         return;    m.matriz[proximox][proximoy] = '@';    m.matriz[heroi.x][heroi.y] = '.';    heroi.x = proximox;    heroi.y = proximoy;}int main() {    lemapa(&m);    encontramapa(&m, &heroi, '@');    do {        imprimemapa(&m);        char comando;        scanf(" %c", &comando);        move(comando);    } while (!acabou());    liberamapa(&m);}

i can't find a solution!


Viewing all articles
Browse latest Browse all 22216

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>