[Interest] WIndows | QMake | DLL

Yves Bailly Yves.Bailly at verosoftware.com
Wed Feb 10 16:13:47 CET 2016


> -----Original Message-----
> I'm trying to build my project on windows using MSVC 2013.
> 
> Project consist of shared lib project and app project. app project
> depends on shared lib.
> 
> Everything is fine, but on final link I always receive error like:
> "cannot open input file MyDll.lib".
> 
> MyDll.dll is built, but MyDll.lib doesn't exists.
> 
> Is it qmake's error?

If you're coming from a GCC world, there's an important difference between GCC and MSVC: GCC exports symbols by default, while MSVC doens't. In MSVC, you need to explicitly exports the symbols you want to link against in other projects.
If you don't export anything, then MSVC won't generate the .lib file.

See:
https://msdn.microsoft.com/en-us/library/3y1sfaz2.aspx
https://msdn.microsoft.com/en-us/library/a90k134d.aspx

...or Google for "__declspec(dllexport)".

Hope this helps,

--
Yves Bailly
Software developer


More information about the Interest mailing list