I have a third party libs. (msvc10) a MT/MD (Static cfgs’s) and dynamic DLL cfg.
I have qt + msvc10 express + win sdk.7
Ok , I use the existing examples offered, (using the libs) I can’t compile ….. I have 4 unresolved external errors of the same lib.
(But I have zero errors for the others)
I have not support for these lib…… (but they are legal, I am a member without rights)
Which are the steps to investigate a possible fix? Where I have to look ?
Thanks.
Edit 1:
The errors was:
TD_ExamplesCommon.lib(ExHostAppServices.obj) : error LNK2019: unresolved external symbol __imp__RegEnumValueW@32 referenced in function "public: virtual bool __thiscall ExHostAppServices::ttfFileNameByDescriptor(class OdTtfDescriptor const &,class OdString &)" (?ttfFileNameByDescriptor@ExHostAppServices@@UAE_N ABVOdTtfDescriptor@@AAVOdString@@@Z)
TD_ExamplesCommon.lib(ExHostAppServices.obj) : error LNK2019: unresolved external symbol __imp__RegCloseKey@4 referenced in function "public: virtual bool __thiscall ExHostAppServices::ttfFileNameByDescriptor(class OdTtfDescriptor const &,class OdString &)" (?ttfFileNameByDescriptor@ExHostAppServices@@UAE_N ABVOdTtfDescriptor@@AAVOdString@@@Z)
TD_ExamplesCommon.lib(ExHostAppServices.obj) : error LNK2019: unresolved external symbol __imp__RegQueryValueExW@24 referenced in function "public: virtual bool __thiscall ExHostAppServices::ttfFileNameByDescriptor(class OdTtfDescriptor const &,class OdString &)" (?ttfFileNameByDescriptor@ExHostAppServices@@UAE_N ABVOdTtfDescriptor@@AAVOdString@@@Z)
TD_ExamplesCommon.lib(ExHostAppServices.obj) : error LNK2019: unresolved external symbol __imp__RegOpenKeyExW@20 referenced in function "public: virtual bool __thiscall ExHostAppServices::ttfFileNameByDescriptor(class OdTtfDescriptor const &,class OdString &)" (?ttfFileNameByDescriptor@ExHostAppServices@@UAE_N ABVOdTtfDescriptor@@AAVOdString@@@Z)
..\exe\OdaQtApp.exe : fatal error LNK1120: 13 unresolved externals
During this post I have received a solution: I have to link with Advapi32.lib…
My question is : how can I know this ?
I have tried the dependencyywalker, but it cant use the .lib’s….
When you get an “unresolved external” error from the linker, that means that it was looking for a match for a function or variable name that some object file needs and the linker was unable to find that name defined in one of the object files or libraries.
Start by looking at the first of these errors (I’ve reformatted it a bit to make it slightly more readable – I encourage yo to do the same next time you come across one of these):
There’s a lot of stuff in that error message (much of it may look like garbage). Fortunately, much of it can be ignored in most cases. The most important item is that the linker is looking for the symbol
__imp__RegEnumValueW@32The name has some gunk on it, but fortunately it’s pretty recognizable anyway.__imp__prefix indicates it’s looking for a DLL import. In nearly all cases that can be ignored for your purposes.@32suffix is something the Microsoft compiler adds to function names for certain calling conventions. It’s also generally not important for your purposes (for the record it indicates that the function expects 32 bytes of argument data)So we’re left with the fact that the linker is looking for
RegEnumValueW. That looks a lot like the name of a Win32 API.If you look at the docs for
RegEnumValueW(orRegEnumValue, since many Win32 APIs have both anAand aWvariant to handle ANSI/UNICODE builds) we’ll find in the documentation this bit of information:That’s how you know you need
advapi32.lib.So in the future, when you get an “unresolved external” error from the linker, just ignore most of the gunk in the error message and concentrate on the symbol it says it can’t find – that should lead you to the library, object file or other item you might be missing.
Just for the record,
advapi32.libwill be needed by most Windows applications of any complexity.