LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   error with structure (https://www.linuxquestions.org/questions/programming-9/error-with-structure-207794/)

rubinbob 07-21-2004 06:07 AM

error with structure
 
Hai All,


I am new to this group and i started studying c programming in linux.when i write a socket program to connect to a server its giving an error in line "struct sockaddr_in addr".

the error is "storage size of 'addr' isnt known"

earlier i used to do programs in c with structures but i dint come across this kind of error.

so please help in above error.

Thanks in advance
rubinbob

shrey_j 07-21-2004 07:02 AM

Hi,

posibly this may help you,

just add this string with the compilation statement

-I<and here goes the path of the include directory>
e.g. gcc -I/usr/src/linux-2.4/include/ filename.c -o filename.o

this should work, as i have tried it.

Hko 07-21-2004 07:55 AM

Check if you have these somewhere at the top of your source file:
Code:

#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>



All times are GMT -5. The time now is 11:54 AM.