Linkage C, UNRESOLVED LINKER ERRORS.
-
Tuesday, April 11, 2006 7:31 PMI 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.
All Replies
-
Tuesday, April 11, 2006 8:14 PMModeratorThese 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 libc
.lib no longer exists with Visual C++ 2005 so you need to link against libcmt
.lib -
Tuesday, April 11, 2006 8:16 PMModeratorArgh: 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:54 PM
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 9:11 PMModerator
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.
-
Tuesday, April 11, 2006 9:19 PMwhen 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:22 PMModeratorThe 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:29 PMOk.
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. -
Friday, January 04, 2008 1:56 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
-
Monday, March 10, 2008 2:02 AM
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

