Thread: Visual Studio Including Winsock Libraries

  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    8

    Visual Studio Including Winsock Libraries

    I'm trying to create a simple winsock client written in C. I'm developing in Visual Studio Express.

    I cut and paste a simple sample client and tried to compile but I receive "Unresolved external 'WSAIoctl' referenced from".

    The build is obviously not linking in the ws2_32 library. Can someone tell how can I configure Visual Studio Express to link in this file?

    Secondary question, I want my final exe file to be completely self contained, I don't want dynamic linking of dlls. How can I do this?

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Project / Properties / Configuration Properties / Linker / Input / Additional Dependencies

    Add the ws2_32.lib to the field above
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #3
    Registered User
    Join Date
    Dec 2009
    Posts
    8

    Cool

    Spot on. Thks CSharpener

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  2. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  3. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM
  4. pointer to array of objects of struct
    By undisputed007 in forum C++ Programming
    Replies: 12
    Last Post: 03-02-2004, 04:49 AM
  5. Visual Studio .NET beta 2
    By Marky_Mark in forum C++ Programming
    Replies: 1
    Last Post: 11-05-2001, 11:28 AM