Qt MSVC2013 cannot link against .dll
-
For some reason the Qt MSVC2013 version always tries to link against .lib files. However, I do need to link against a dynamic linked library (.dll). Is there a way to force the MSVC linker to use .dll files?
Regards
Strahlex -
Hi,
That's normal, you don't link against dlls but either against "import libraries":http://en.wikipedia.org/wiki/Dynamic-link_library#Import_libraries or static libraries, both having the same extension.
-
Interesting. For some reason my Qt library project only creates a dll file no .lib. Is there a way to force Qt creating the .lib file without making the library static?
-
Are you exporting any symbol from your library ? If not, then on Windows you won't have any import library generated.
-
Not explicitly. I export only descriptor classes generated by protobuf. It works everywhere except on Windows. But, for some reason it seems to be no problem to use the static library on Windows anyway (on other platforms protobuf classes do not like to be included more than once)
-
Then you should do the exports. Qt has some macro helpers for that that you can re-use.