Dlltool produces broken import libs, when it is fed with object files with functions with __declspec(dllexport).
Reproduced with the attached test project with the packages mingw-w32-1.0-bin_i686-mingw_20101015.zip and mingw-w64-1.0-bin_i686-mingw_20101015.zip on 64-bit Windows7 and 32-bit Windows XP. objdump -t reveals tha lib contains symbols "DllFunc@0" and __imp__"DllFunc@0". (Yes, the symbol names contain the quotes.) Hence any attempt to use the import lib for linking any program fails because of unresolved symbols.
Workaround is to feed the dlltool with a *.def file instead of the object files. Then the symbol names do not contain the quotes.
Log in to post a comment.