Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component

Index of Chilkat Blog Posts

December 8, 2006

How to Resolve an Unresolved External in Visual C++

This post tells you how to determine what Microsoft libs need to be added when you get a link error regarding an unresolved external reference. For example:

19: unresolved external symbol _DnsQuery_A@24 referenced in function \"public: bool __thiscall Mx::MailToSmtpHost(char const *,class chilkat::StringBuffer &,class LogBase &)\" (?MailToSmtpHost@Mx@@QAE_NPBDAAVStringBuffer@chilkat@@AAVLogBase@@@Z)
..\absdebug\Admin.exe : fatal error LNK1120: 1 unresolved externals
  1. Search the site for the function name. In this case, the fact that the function ends in "_A" tells us that its the ANSI version of the function. The Unicode version would end in "_W". When searching, leave off the "_A" or "_W". Go to and type "DnsQuery".
  2. The first search result is most likely to be the MSDN page for your unresolved function. Click on it and scroll to the bottom of the page. Look for the Requirements table. It will tell you the operating systems supported, the name of the .h header file it is found in, and the name of the .lib file that must be included in your list of link libs in the Visual C++ Project Settings. In this case, it is dnsapi.lib

That’s all there is to it!

Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.