-->

Linking against WinNLS

2019-09-04 14:49发布

问题:

What static library should I use to link against to use the NormalizeString() function?

In contrast with most functions documented on MSDN, the static library required to use the function is not declared. I tried using the name derived from the DLL: normaliz.lib and it successfully linked, but then I get a pop-up at runtime saying Normalization.dll could not be found on my computer and the process is shut down.

回答1:

As pointer out by Hans Passant, the correct import library is normaliz.lib. It seems there was some problem in my setup.

I was using Windows SDK v6.0A. After switching to Windows SDK v7.0A, my problems stopped.



回答2:

The link at the bottom-ish of the page you linked states that the download contains implib and dll resources. You probably have to manifest the dll, or at least put it into PATH.