Jump to content

programação com sockets


Rat
 Share

Recommended Posts

comecei a programação com sockets em C e li a revista numero 7 para ver se percebia a coisa, o problema é que quando tento compilar o codigo dá-me sempre erros, ja aconteceu isto a alguem? podiam me dizer como resolver?

Diz que tipo de erros te dão. Já agora, estás a programar em linux ou Windows? É que são usadas algumas bibliotecas típicas dos sistemas UNIX por isso é normal que não dê em Windows.

"Nunca discutas com um idiota. Eles arrastam-te até ao seu nível e depois ganham-te em experiência"

Link to comment
Share on other sites

estou a programar em linux

os erros sao:

cliente:

client.c:20: error: initializer element is not constant

client.c:29: error: expected declaration specifiers or '...' before '(' token

client.c:29: error: expected declaration specifiers or '...' before 'ad1'

client.c:29: warning: data definition has no type or storage class

client.c:29: warning: type defaults to 'int' in declaration of 'bzero'

client.c:29: error: conflicting types for 'bzero'

client.c:34: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token

client.c:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token

client.c:40: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token

client.c:44: error: expected identifier or '(' before 'if'

client.c:51: error: expected identifier or '(' before 'do'

servidor:

servidor.c:18: error: initializer element is not constant

servidor.c:26: error: expected declaration specifiers or '...' before '(' token

servidor.c:26: error: expected declaration specifiers or '...' before 'ad1'

servidor.c:26: warning: data definition has no type or storage class

servidor.c:26: warning: type defaults to 'int' in declaration of 'bzero'

servidor.c:26: error: conflicting types for 'bzero'

servidor.c:31: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token

servidor.c:34: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.