For those experienced in Sockets Programming

This is a discussion on For those experienced in Sockets Programming within the C++ Programming forums, part of the General Programming Boards category; Hello people! When I compile my code for TCP/IP using winsock.h & windows.h, it compiles flawlessly. But then everytime I ...

  1. #1
    Registered User billholm's Avatar
    Join Date
    Apr 2002
    Posts
    225

    Question For those experienced in Sockets Programming

    Hello people!

    When I compile my code for TCP/IP using winsock.h & windows.h, it compiles flawlessly. But then everytime I build my binary, linker errors pop out from nowhere:

    Linker Error: Undefined SOCKET blah blah blah...
    Linker Error: Undefined GETHOSTBYNAME blah blah blah...
    etc...
    etc...
    etc...

    I already checked my header file and it did contain typedefs for SOCKET and other relevant declarations.

    Do I need to link the winsock.dll itself to my obj file after I compile my code?

    Analyzing sockets are pretty tough, but it's challenging. Hope you guys out there can assist.

    Thanks!
    All men are created equal. But some are more equal than others.

    Visit me at http://www.angelfire.com/my/billholm

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    421
    make sure you link wsock32.lib into your project (specify this in the project settings).

    hope this helps
    U.
    Quidquid latine dictum sit, altum sonatur.
    Whatever is said in Latin sounds profound.

  3. #3
    Registered User billholm's Avatar
    Join Date
    Apr 2002
    Posts
    225
    Hmmm... now why haven't I thought of that!

    I did try linking my winsock.dll directly but it only produced lots more errors hehehe... (Oh shuck! Dumb me!)

    I'll try it home Ulrador. 'wsock32.lib' right? I'll consult you again if some errors come up again.

    Oh by the way, I'm using Borland C++ 3.1. Don't know if wsock32.lib is packaged with it.
    All men are created equal. But some are more equal than others.

    Visit me at http://www.angelfire.com/my/billholm

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    249

    I will be studying that........

    I will post a lot of threads about that in this summer, as I will be studying it.

    I may need your help....

    C++ is tough.... I do agree with you....
    C++
    The best

  5. #5
    Registered User billholm's Avatar
    Join Date
    Apr 2002
    Posts
    225

    Talking

    Hey Nano can you provide me with somelinks to your posts or sites?

    I'm very much interested to study some of your code too.
    All men are created equal. But some are more equal than others.

    Visit me at http://www.angelfire.com/my/billholm

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Best way to poll sockets?
    By 39ster in forum Networking/Device Communication
    Replies: 3
    Last Post: 07-22-2008, 01:43 PM
  2. multiple UDP sockets with select()
    By nkhambal in forum Networking/Device Communication
    Replies: 2
    Last Post: 01-17-2006, 06:36 PM
  3. inet_aton()... Noob needs help with sockets :|
    By Maz in forum C++ Programming
    Replies: 3
    Last Post: 11-22-2005, 03:33 PM
  4. Raw Sockets and SP2...
    By Devil Panther in forum Networking/Device Communication
    Replies: 11
    Last Post: 08-12-2005, 04:52 AM
  5. Starting window sockets
    By _Cl0wn_ in forum Windows Programming
    Replies: 2
    Last Post: 01-20-2003, 10:49 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21