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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

winsock help!!

  • 25-03-2004 8: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, Registered Users 2 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, Registered Users 2 Posts: 2,013 ✭✭✭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, Registered Users 2 Posts: 2,013 ✭✭✭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