none
Linkage C, UNRESOLVED LINKER ERRORS.

    Question

  • I wanna use Linkage C in my code in visual Studio 2003 ,
    when i add library file in Tools/Options in Lib section (in these case
    my library is C:\WINDDK\3790\lib\wxp\i386)

    I get linker error ! that can not resolve some things.

    test error LNK2019: unresolved external symbol @_RTC_CheckStackVars@8 referenced in function "unsigned int __stdcall ATL::_AtlGetThreadACPThunk(void)" (?_AtlGetThreadACPThunk@ATL@@YGIXZ)
    test error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8
    test error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8
    test error LNK2019: unresolved external symbol __RTC_CheckEsp referenced in function "unsigned int __stdcall ATL::_AtlGetThreadACPThunk(void)" (?_AtlGetThreadACPThunk@ATL@@YGIXZ)
    test error LNK2001: unresolved external symbol __RTC_CheckEsp
    test error LNK2001: unresolved external symbol __RTC_CheckEsp
    test error LNK2001: unresolved external symbol __RTC_Shutdown
    test error LNK2001: unresolved external symbol __RTC_Shutdown
    test error LNK2001: unresolved external symbol __RTC_Shutdown
    test error LNK2001: unresolved external symbol __RTC_InitBase
    test error LNK2001: unresolved external symbol __RTC_InitBase
    test error LNK2001: unresolved external symbol __RTC_InitBase
    test error LNK2001: unresolved external symbol @__security_check_cookie@4
    test error LNK2001: unresolved external symbol @__security_check_cookie@4
    test error LNK2001: unresolved external symbol @__security_check_cookie@4
    test error LNK2001: unresolved external symbol @__security_check_cookie@4
    test error LNK2001: unresolved external symbol @__security_check_cookie@4
    test error LNK2019: unresolved external symbol @__security_check_cookie@4 referenced in function "unsigned int __stdcall ATL::_AtlGetThreadACPThunk(void)" (?_AtlGetThreadACPThunk@ATL@@YGIXZ)
    test error LNK2001: unresolved external symbol @__security_check_cookie@4
    test error LNK2001: unresolved external symbol @__security_check_cookie@4
    test error LNK2001: unresolved external symbol @__security_check_cookie@4

    I CAN NOT UNDERSTAND WHY THESE ERRORS DID NOT SOLVE IN VISUAL STUDIO 2005 !!!!!!!!


    But i have not any problems in Visual Studio 6.0.
    can anyone help me?

    Best Regards.
    Tuesday, April 11, 2006 7:31 PM

Answers

All replies

  • These all look like symbols that we have recently added to the libraries, or at least added since Visual C++ 6.0. Are you sure you are linking against the correct libraries? Specifically libcDrinks.lib no longer exists with Visual C++ 2005 so you need to link against libcmtDrinks.lib
    Tuesday, April 11, 2006 8:14 PM
    Moderator
  • Argh: I hate automatice emoticons. What I was trying to say was that as libc.lib and libcd.lib no longer exist you need to link against libcmt.lib or libcmtd.lib
    Tuesday, April 11, 2006 8:16 PM
    Moderator
  • Yes my library contains those files.  libc.lib

    So i can not use DDK to access API functions???

    i wanna use these library:

    extern "C" {

    // This file is in the Windows DDK available from Microsoft.

    #include "hidsdi.h"

    #include <setupapi.h>

    #include <dbt.h>

    }

    when i add library file to project options that errors occur.

    when i delete that directory of DDK : C:\WINDDK\3790\lib\wxp\i386

    the problem solved but another problem occur  :

    when i use function that declare in hidsdi.h for example HidD_GetHidGuid this error occur :

    1>Dlg.obj : error LNK2019: unresolved external symbol _HidD_GetHidGuid@4 referenced in function "public: void __thiscall CjigarDlg::OnBnClickedButton1(void)" (?OnBnClickedButton1@CDlg@@QAEXXZ)

    how can i solve that is there anyway .

     

    Best Regards.

     

    Tuesday, April 11, 2006 8:54 PM
  • It appears that you have a library that depends on libc.lib: you need to make it link to libcmt.lib instead. A newer version of the DDK might fix this otherwise you might need to start investigating the /NODEFAULTLIB linker option.

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_.2f.nodefaultlib.asp

    Tuesday, April 11, 2006 9:11 PM
    Moderator
  • when i use that switch that error linker solve.
    But about 189 error linker occur .

    I use DDK 2003  i think there is no new version.

    Best Regards.

    Tuesday, April 11, 2006 9:19 PM
  • The slew of linker errors are expected (as the /NODEFAULTLIB option has told the linker to ignore any implicit dependencies it might find). You need to explicitly add all the libraries that the program depends upon as inputs to the linker. The /VERBOSE is useful for tracking these down.
    Tuesday, April 11, 2006 9:22 PM
    Moderator
  • Ok.
    can you tell me where can i  find list of libraries to run simple MFC dialog program.
    I just know i must use visual C++ 6.0 .

    But please send feedback.

    Best Regards.

    Tuesday, April 11, 2006 9:29 PM
  • Hello Coomputed_Mind,

     

    As I understand, the "Linkage Error" happend when a library file is not linked correctly.

     

    I have the smilliar situation with you.

    I use visual studio 2008, recent wdk (including ddk).

    I got two kinds of error - linkage error, include file error. It happended individually.

     

    If you have two kinds of problems, you should first solve the error regarding to include files.

    And then focuse to solve linkage error. ;-)

     

    1. Check you correctly do for #include "your file".

    2. [Visual Studio 6++]  Check the "Project Settings" > "Link" > "Input" > "Project Options" has your library lists.

       [ Visual Studio 2008] Check the "Proejct Pages" > "Configuration Properties" > "Linker" > "Command Line" > "All options" has your library lists.

    In my case, I put my library lists on "Additional Options" instead of "All options". Then it solved out.

     

    Please keep in mind that if you have linkage error, it means you don't make your program correctly link your library.

     

    Good Luck!

     

    Best Regards,

    Anna

     

    Friday, January 04, 2008 1:56 PM
  • I am working in C++ with MS-Visual Studio 2005.  I'm working with the USB interface.  By linking with the setupapi.lib I am now down to two unresolved externals:

     

    usbhidioc.obj : error LNK2001: unresolved external symbol _HidD_GetAttributes@8

    usbhidioc.obj : error LNK2001: unresolved external symbol _HidD_GetHidGuid@4

     

    Is there something else I need to link-in to resolve these two externals?

     

    Any suggestions would be greatly appreciated - my hair is already grey enough.

     

    Thanks,

    MichaelVN900

    Monday, March 10, 2008 2:02 AM