Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unresolved external symbol - IdnToAscii

I tried to build the following sample application available on msdn: http://msdn.microsoft.com/en-us/library/windows/desktop/dd319089%28v=vs.85%29.aspx

I created a new C++ command line project in Visual Studio 2012 Premium on a windows 7 64bit box, and copied the code of the sample in the main cpp file.

When I try to compile, I get the following error:

Error   1   error LNK2001: unresolved external symbol __imp__IdnToAscii@20

From other posts of people having similar errors, I figure I'm supposed to include some header or lib file. But which one(s)? How do I do that in VS2012/C++ (I'm a complete c++ noob...)

like image 996
marapet Avatar asked Sep 21 '12 12:09

marapet


People also ask

How do I fix unresolved external symbol?

So when we try to assign it a value in the main function, the linker doesn't find the symbol and may result in an “unresolved external symbol” or “undefined reference”. The way to fix this error is to explicitly scope the variable using '::' outside the main before using it.

How do I fix unresolved external symbol lnk2001?

To fix this issue, add the /NOENTRY option to the link command. This error can occur if you use incorrect /SUBSYSTEM or /ENTRY settings in your project. For example, if you write a console application and specify /SUBSYSTEM:WINDOWS, an unresolved external error is generated for WinMain .


1 Answers

It seems from MSDN, you need to link against Normaliz.dll.

Try adding Normaliz.lib in Linker -> Input -> Additional Dependencies

Image

like image 127
Mahesh Avatar answered Sep 22 '22 13:09

Mahesh