Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

winsock help!!

Options
  • 25-03-2004 9:02pm
    #1
    Closed Accounts Posts: 17


    hello,
    just trying my hand at some winsock programming and i'm obviously missing something cause i keep getting errors such as:

    wsclient.obj : error LNK2019: unresolved external symbol _WSACleanup@0 referenced in function _main
    wsclient.obj : error LNK2019: unresolved external symbol _closesocket@4 referenced in function _main
    wsclient.obj : error LNK2019: unresolved external symbol _recv@16 referenced in function _main

    ok, the code i'm working with is taking from here

    http://frenchwhale.gotdns.com/winsockt/Lesson2.htm

    there is a #include <winsock.h> so why can't the linker see the functions???

    do i have to set special parameters for the project properties or something??

    im using VisualStudio.net btw

    any help or ideas would be appreciated,
    bostitch.


Comments

  • Closed Accounts Posts: 1,502 ✭✭✭MrPinK


    Have you added wsock32.lib to your list of library files?

    Not sure if it's the same with .NET but in VS6 it's under Project->Settings->Link, the 'Object/libraries modules' box.


  • Closed Accounts Posts: 17 Bostitch


    duh,
    cheers for that, knew i was missing something!!!

    added the file WS2_32.lib to the project properties under

    properties->linker->additional dependencies

    and it all seems to work sweet now!!

    thanks
    bostitch


  • Closed Accounts Posts: 18,239 ✭✭✭✭WindSock


    Here I aaammmmmm. What seems to be the problem, liddle lady? Oh, you spelled my name wrong, never mind.


  • Registered Users Posts: 981 ✭✭✭fasty


    You can also use pragmas to link to libraries in your source files.
    #pragma comment(lib, "WS2_32.lib")
    

    Sometimes I find this better when writing wrappers for Window stuff and don't want to have to add stuff to the project settings each time.


  • Registered Users Posts: 1,994 ✭✭✭lynchie


    WindSock wrote: »
    Here I aaammmmmm. What seems to be the problem, liddle lady? Oh, you spelled my name wrong, never mind.

    Havent seen a mod drag up a 7 yr old zombie thread before :rolleyes:


  • Advertisement
  • Closed Accounts Posts: 884 ✭✭✭spider guardian


    Bostitch are ya still using C90?


  • Registered Users Posts: 1,994 ✭✭✭lynchie


    Bostitch are ya still using C90?

    Considering his last post on boards was 7 years ago, I dont think your going to get a reply from him :rolleyes:


Advertisement