With Visual Studio 2010 and older versions, set the linker option /OPT:NOREF to
use the DLLs. This is not necessary with newer Visual Studio versions.

Details:

The linker in Visual Studio 2010 (and possibly older versions) cannot link with
DLLs generated by dlltool if /OPT:REF is used. This setting is often the default
for Release builds; in Debug mode, /OPT:NOREF is used and there is no problem.

You can change this setting at Project Properties -> Configuration Properties
-> Linker -> Optimization -> References -> Keep Unreferenced Data (/OPT:NOREF).

See http://sourceware.org/bugzilla/show_bug.cgi?id=12633 for more information.
