Re: error al compilar
> Al compilar esto en mi maquina me da error
>
> gcc -c CLIENTE.C -o cliente
^^^^^^^^^
¿Por qué mayúsculas?
debe saber que .C (en mayuscula) es lo mismo que .cpp por tanto esta
obligando a compilar un programa c como si fuera C++ cuando no lo es,
cambie el nombre de su archivo fuente a .c (en minúscula) y compile...
Saludos!
nmag only
_______________
> CLIENTE.C: In function `int main(int, char **)':
> CLIENTE.C:24: implicit declaration of function `int atoi(...)'
>
> Compilation exited abnormally with code 1 at Tue Dec 23 12:29:05
>
> En cambio en la máquina de otro funciona bien, es problema de mi compilador
> ??
>
> # include <stdio.h>
> # include <errno.h>
> # include <unistd.h>
> # include <string.h>
> # include <fcntl.h>
>
> void panic (char *miss){
> fprintf(stderr, "%s %s\n",miss,strerror(errno));
> exit(-1);
> }
>
> int main(int argc, char* argv[])
> {
> int n, fd, envio, recept;
> char str[256];
> char c;
>
> if(argc !=3 ) panic ("error argumentos incorrectos clente");
>
>
> fd = open("./client/result_comanda",O_WRONLY|O_CREAT|O_APPEND,0644);
> if (fd<0)panic("error abriendo fichero result_comanda");
> envio = atoi(argv[1]);
> recept = atoi(argv[2]);
> //do{
> printf("ya puede introducir los comandos que desea ejecutar\n");
> scanf("%s", str);
> read(0, &str, strlen(str));
> write (envio,&str,strlen(str));
> printf("COMANDO ENVIADO\n");
>
> while(read(recept,&c,sizeof(char))>0){
> write(1,&c,sizeof(char));
> write(fd,&c,sizeof(char));
> }
> printf("respuesta recibida\n");
>
> //}while(strcmp(str,"exit")!= 0 );
> close(envio);
> close(recept);
> close(fd);
>
> }
>
> ---Publicidad--------------------------------------------------------
> Únete a los miles de sin pareja en Meetic... ¡te vas a enamorar!
> http://www.iespana.es/_reloc/email.meetic
>
>
> --
> To UNSUBSCRIBE, email to debian-user-spanish-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
--
nmag only
gnupg keyID: 0xA024A03F [http://pgp.mit.edu/]
GNU/Linux Registered User #312624
Reply to: