Dev - C++ - Me sale [Error] ld returned 1 exit status

 
Vista:

Me sale [Error] ld returned 1 exit status

Publicado por Me llamo (1 intervención) el 19/10/2019 00:07:15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <conio.h>
#include <stdio.h>
#include <windows.h>
#include <string.h>
#include <stdlib.h>
#include <iostream>
 
void gotoxy(int x, int y)
{
	HANDLE hnave;
	hnave = GetStdHandle(STD_OUTPUT_HANDLE);
	COORD dwPos;
	dwPos.X = x;
	dwPos.Y = y;
 
    SetConsoleCursorPosition(hnave, dwPos);
 
}
 
 
int main(){
 
     gotoxy(15,10); printf("*");
     int x = 10,y = 10;
 
 
	 bool GameOver = false;
	 while(!GameOver){
	    gotoxy(x,y); printf("*");
 
	 	if(kbhit()
		 {
	 	    char tecla = getch();
	 	    gotoxy(x,y); printf(" ");
	 		if(tecla == 'j') x--;
	 		if(tecla == 'l') x++;
	 	        if(tecla == 'i') y--;
	 	        if(tecla == 'k') y++;
	    }
 
 
	 }
 
         return 0;
}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Alfil
Val: 4.344
Oro
Ha mantenido su posición en Dev - C++ (en relación al último mes)
Gráfica de Dev - C++

Me sale [Error] ld returned 1 exit status

Publicado por Alfil (1444 intervenciones) el 19/10/2019 05:50:51
Te falta un parentesis de cierre en la instrucción:

1
2
3
4
5
6
7
8
9
if( kbhit() )
{
    char tecla = getch();
    gotoxy(x,y); printf(" ");
    if(tecla == 'j') x--;
    if(tecla == 'l') x++;
    if(tecla == 'i') y--;
    if(tecla == 'k') y++;
}
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar