LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-21-2004, 06:07 AM   #1
rubinbob
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
rubinbob
 
Old 07-21-2004, 07:02 AM   #2
shrey_j
Member
 
Registered: Jul 2004
Location: Delhi
Distribution: FC3, RH 9.0
Posts: 39

Rep: Reputation: 16
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.
 
Old 07-21-2004, 07:55 AM   #3
Hko
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:
Code:
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
 
  


Reply


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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:44 PM.

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