sockets-winsock inclusion

Discussion in 'C' started by altafahmed2k4, Nov 23, 2006.

  1. altafahmed2k4

    altafahmed2k4 New Member

    Joined:
    Aug 26, 2006
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    HI,

    I am using microsoft visual c++ 2005 express edition

    Now i want to do socket programming in windows

    for which i require winsock API which i do have as a dll file in my system file

    but i dont have winsock.h in library files of my compiler

    which is necessary for the purpose

    can any one tell me

    how to create a header file named winsock.h from that api or else .......
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
  3. altafahmed2k4

    altafahmed2k4 New Member

    Joined:
    Aug 26, 2006
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    Thank you very much shabbir
     
  4. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
  5. altafahmed2k4

    altafahmed2k4 New Member

    Joined:
    Aug 26, 2006
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    Hi,

    Can anyone give me a hint of writing a

    SOCKET program for client and server which should run both in windows as well as Linux

    with no change in the code i welcome as many possible solutions to this as possible.
     
  6. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    Try using #ifdef to check for the OS type and include the appropriate header file.Also, do the same thing where the function name differs. I hope the idea is clear to you.
     
  7. altafahmed2k4

    altafahmed2k4 New Member

    Joined:
    Aug 26, 2006
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    pradeep can you still stress it how using #ifdef to identify os
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice