none
Error LNK2019

    Question

  • Hi all,

    When i tried to Build my source(In .Net 2003) i am getting these error.Same code is working in debug mode But in release mode onlly i am getting these eroors can any one help me with this.


    error LNK2019: unresolved external symbol __imp__closesocket@4 referenced in function "public: __thiscall CKVMClient::~CKVMClient(void)" (??1CKVMClient@@QAE@XZ)

    error LNK2019: unresolved external symbol __imp__setsockopt@20 referenced in function "public: int __thiscall CKVMClient::create_and_connect(char const *,unsigned short)" (?create_and_connect@CKVMClient@@QAEHPBDG@Z)

    error LNK2019: unresolved external symbol __imp__connect@12 referenced in function "public: int __thiscall CKVMClient::create_and_connect(char const *,unsigned short)" (?create_and_connect@CKVMClient@@QAEHPBDG@Z)

    error LNK2019: unresolved external symbol __imp__inet_addr@4 referenced in function "public: int __thiscall CKVMClient::create_and_connect(char const *,unsigned short)" (?create_and_connect@CKVMClient@@QAEHPBDG@Z)

    error LNK2001: unresolved external symbol __imp__send@16

    error LNK2001: unresolved external symbol __imp__select@20



    anu
    Thursday, June 05, 2008 9:46 AM

Answers

  • a142 said:

    Hi all,

    When i tried to Build my source(In .Net 2003) i am getting these error.Same code is working in debug mode But in release mode onlly i am getting these eroors can any one help me with this.


    error LNK2019: unresolved external symbol __imp__closesocket@4 referenced in function "public: __thiscall CKVMClient::~CKVMClient(void)" (??1CKVMClient@@QAE@XZ)

    error LNK2019: unresolved external symbol __imp__setsockopt@20 referenced in function "public: int __thiscall CKVMClient::create_and_connect(char const *,unsigned short)" (?create_and_connect@CKVMClient@@QAEHPBDG@Z)

    error LNK2019: unresolved external symbol __imp__connect@12 referenced in function "public: int __thiscall CKVMClient::create_and_connect(char const *,unsigned short)" (?create_and_connect@CKVMClient@@QAEHPBDG@Z)

    error LNK2019: unresolved external symbol __imp__inet_addr@4 referenced in function "public: int __thiscall CKVMClient::create_and_connect(char const *,unsigned short)" (?create_and_connect@CKVMClient@@QAEHPBDG@Z)

    error LNK2001: unresolved external symbol __imp__send@16

    error LNK2001: unresolved external symbol __imp__select@20



    anu



    Did you link your libraries properly? Since your error states you have a socket error,
    I doubt that you have included the necessary library files..

    So right click the main project in your solution explorer, and click properties..
    Expand the linker and goto Input
    In additional dependencies, add this library file: Ws2_32.lib
    Then clean the solution and then build..

    Hope this would work, in case of any other problems, please re-post..

    Hope this helps !!

    Always mark the post that helped you as "Answer". That helps future users to locate answers quickly.
    Thursday, June 05, 2008 9:55 AM

All replies

  • a142 said:

    Hi all,

    When i tried to Build my source(In .Net 2003) i am getting these error.Same code is working in debug mode But in release mode onlly i am getting these eroors can any one help me with this.


    error LNK2019: unresolved external symbol __imp__closesocket@4 referenced in function "public: __thiscall CKVMClient::~CKVMClient(void)" (??1CKVMClient@@QAE@XZ)

    error LNK2019: unresolved external symbol __imp__setsockopt@20 referenced in function "public: int __thiscall CKVMClient::create_and_connect(char const *,unsigned short)" (?create_and_connect@CKVMClient@@QAEHPBDG@Z)

    error LNK2019: unresolved external symbol __imp__connect@12 referenced in function "public: int __thiscall CKVMClient::create_and_connect(char const *,unsigned short)" (?create_and_connect@CKVMClient@@QAEHPBDG@Z)

    error LNK2019: unresolved external symbol __imp__inet_addr@4 referenced in function "public: int __thiscall CKVMClient::create_and_connect(char const *,unsigned short)" (?create_and_connect@CKVMClient@@QAEHPBDG@Z)

    error LNK2001: unresolved external symbol __imp__send@16

    error LNK2001: unresolved external symbol __imp__select@20



    anu



    Did you link your libraries properly? Since your error states you have a socket error,
    I doubt that you have included the necessary library files..

    So right click the main project in your solution explorer, and click properties..
    Expand the linker and goto Input
    In additional dependencies, add this library file: Ws2_32.lib
    Then clean the solution and then build..

    Hope this would work, in case of any other problems, please re-post..

    Hope this helps !!

    Always mark the post that helped you as "Answer". That helps future users to locate answers quickly.
    Thursday, June 05, 2008 9:55 AM
  • Hi Thanks its working fine after implimented ur thoughts.


    anu
    Thursday, June 05, 2008 10:39 AM
  • a142 said:

    Hi Thanks its working fine after implimented ur thoughts.


    anu



    A Tip:
    Always keep building the project in release mode at periodic intervals to avoid problems at a later stage ..
    Always mark the post that helped you as "Answer". That helps future users to locate answers quickly.
    Thursday, June 05, 2008 11:18 AM
  • Thanks somnath.... this have saved my lots of time... 
    Saturday, January 24, 2009 12:12 PM