Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 07-21-2004, 06:07 AM   #1
LQ Newbie
Registered: Jul 2004
Posts: 1

Rep: Reputation: 0
Exclamation 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
Old 07-21-2004, 07:02 AM   #2
Registered: Jul 2004
Location: Delhi
Distribution: FC3, RH 9.0
Posts: 39

Rep: Reputation: 16

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.
Old 07-21-2004, 07:55 AM   #3
Senior Member
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Check if you have these somewhere at the top of your source file:
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
"WARNING: Circular directory structure" error when deleting directory pistonbrew Linux - Software 5 02-03-2005 06:05 AM
error in accessing structure variable in kernel modules dypgrp Programming 3 01-17-2005 07:42 AM
error coding structure in c shams Programming 9 08-24-2004 10:02 AM
Undefined reference Error in list data structure ashwinipahuja Programming 1 04-29-2004 05:11 PM
graphics programming in vi: using the structure REGS is giving a compilation error sohamdas Programming 1 04-26-2004 04:38 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:46 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration