Link to home
Start Free TrialLog in
Avatar of MetalManiac
MetalManiac

asked on

Easy Question... Where do you get header files from?

I'm new to c, and I've been trying to compile some sample programs, and I can't seem to find where header files such as:

#include sys/types.h
#include sys/socket.h
#include netdb.h
#include netinet/in.h

These seem to be the basic for networking programs, but where do I get them from? I am using MS Visual C++

Thanks!
 

Avatar of akshayxx
akshayxx
Flag of United States of America image

it seems the source code that u r trying to compile is meant for UNIX and other similar systems..
for networking programs on windows .. there different include headers and linking libraries...
OR u'll have to get hold of something like cygwin/mingw32
btw on linux and other UNIces these headers are usually placed in the directory
/usr/include

Avatar of MetalManiac
MetalManiac

ASKER

Will cygwin or mingw32 have these headers, and if so, will they work in visual c++?  Or will i have to compile with those programs?
Will cygwin or mingw32 have these headers, and if so, will they work in visual c++?  Or will i have to compile with those programs?
i have doubt they will work with visual c++ as it is ..
but cygwin etc come with gcc/g++ .. which is another C/c++ compiler , till that do ,, and why do u want to go with the given source code ... why dont u have a look at winsock examples..?
ASKER CERTIFIED SOLUTION
Avatar of r_a_j_e_s_h
r_a_j_e_s_h

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
<sys/socket.h> and some others is for unix socket programming in C for windows socket programming in C/C++ use winsock.h winsock2.h
Avatar of Mayank S
>> #include sys/types.h

Excuse my ignorance (if it is so), but is there any compiler which will allow you to specify the name of a header-file in the #include directive without <> or "" as <stdio.h> or "MyFile.h" ??

Mayank.
>>Excuse my ignorance (if it is so),

hehe :)
:-)

No compiler would allow: #include sys/types.h

without the angular-braces or quotes, would it :-)

Mayank.
>>No compiler would allow: #include sys/types.h

u always have option to write your own compiler ..
:-)
Please.... the Compiler Design lab is history now, and I don't wanna think about it again :-))

Nothing has happened on this question in more than 9 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
accept answer by r_a_j_e_s_h.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer