[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] Problemas con sockets




Mario Palomo wrote:

Yo los he compilado sin errores, eso sí, con muchos warnings que deberías repasar:

$ gcc -o cliente cliente.c -Wall
cliente.c: In function 'main':
cliente.c:32: warning: implicit declaration of function 'exit'
cliente.c:32: warning: incompatible implicit declaration of built-in function 'exit' cliente.c:38: warning: incompatible implicit declaration of built-in function 'exit' cliente.c:44: warning: incompatible implicit declaration of built-in function 'exit'
cliente.c:52: warning: implicit declaration of function 'bzero'
cliente.c:52: warning: incompatible implicit declaration of built-in function 'bzero' cliente.c:58: warning: incompatible implicit declaration of built-in function 'exit' cliente.c:64: warning: incompatible implicit declaration of built-in function 'exit'
cliente.c:72: warning: implicit declaration of function 'close'
cliente.c:74: warning: control reaches end of non-void function

$ gcc -o servidor servidor.c -Wall
servidor.c:11: warning: return type defaults to 'int'
servidor.c: In function 'main':
servidor.c:26: warning: implicit declaration of function 'exit'
servidor.c:26: warning: incompatible implicit declaration of built-in function 'exit'
servidor.c:37: warning: implicit declaration of function 'bzero'
servidor.c:37: warning: incompatible implicit declaration of built-in function 'bzero' servidor.c:45: warning: incompatible implicit declaration of built-in function 'exit' servidor.c:50: warning: incompatible implicit declaration of built-in function 'exit' servidor.c:57: warning: pointer targets in passing argument 3 of 'accept' differ in signedness servidor.c:59: warning: incompatible implicit declaration of built-in function 'exit'
servidor.c:63: warning: implicit declaration of function 'inet_ntoa'
servidor.c:63: warning: format '%s' expects type 'char *', but argument 2 has type 'int'
servidor.c:69: warning: implicit declaration of function 'close'


Juan Pablo Alesandri escribió:

buenas, nuevamenteyo con un nuevo problema. Alguien me puede decir que puede estar pasando con estos programas en c que no compilan???? Son dos programas que hacen uso de sockets para una comunicacion cliente-servidor. Les adjunto los programitas
gracias





Buenas!

   Un par+1 de cosas:
     1. Esta lista es de debian, no de consultas de programación
     2. El mensaje es Off-Topic
     3. Te lo digo de buen rollo ;)

Y respondiendo a tu problema te faltan archivos de cabecera. Por ejemplo, bzero se encuentra definida en string.h. Los otros errores y warnings son también por falta de cabeceras.

taluego!

--
o o o  Jesús Del Río Rodríguez
o o o  E-mail:  jdelrio@lsi.upc.edu
o o o  Laboratorio de Cálculo del LSI
U P C Universidad Politécnica de Cataluña (Campus Norte)

Linux User #387299
Linux machine #287697
http://counter.li.org/

"overflow error in /dev/null"
"Software is like sex: it's better when it's free." (Linus Torvalds)
"This is Linux-Land. In quiet nights, you can hear the Windows machines reboot"



Reply to: