c++ - error LNK2005: _sprintf already defined in ntdll.lib(ntdll.dll) -


i'm linking against ntdll.lib use zwqueryinformationprocess , using multi-threaded runtime library.

ntdll seems define of crt functions. so, when link against , use runtime library, linker errors.

can force linker use crt functions , ignore ntdll symbols rid of error? or somehow else solve error.

i know documentation of zwqueryinformationprocess suggests dynamic loading, it's used in static lib main project linking to, , has been working fine long time, i'd prefer not change it.

thanks.

i've found few discussions on other sites, eg: http://www.codeguru.com/forum/archive/index.php/t-414274.html haven't seen seems provide solution. there mentions of changing link order, can't see how change order in runtime library links via project settings.

changing link order seems solve it. change order of automatically linked libs, need ignore them adding "ignore specific library" , re-add them "additional dependencies" in order want them linked. error message this:

1>libcmt.lib(wcstol.obj) : error lnk2005: _wcstoul defined in ntdll.lib(ntdll.dll) 

so, added libcmt.lib ignored, , placed @ start of additional dependencies. produced error, followed same steps. so, project properties ended looking (ntdll.lib @ end of additional dependencies):

project properties screenshot

i found adding /verbose:lib linker -> command line -> additional options useful can see libs being linked , in order.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -