[CMake] Win32: Link failure with ADD_LIBRARY SHARED

Stephen Collyer scollyer at netspinner.co.uk
Thu Nov 15 10:09:40 EST 2007


Stephen Collyer wrote:

> When I add a SHARED specifier to the ADD_LIBRARY command for
> the Test library, the exe builds and run fine on Linux, but
> fails at link time when the projects are built under Visual
> Studio, with a message:
> 
> LINK : fatal error LNK1104: cannot open file 'Test.lib'
> 
> Now, I'm no Windows expert but AFAIK, linking against a
> DLL is done by looking at the contents of a .lib file,
> which indicates the symbols exported by the DLL. However,
> there's no .lib file at all in the build tree, so I'm
> confused as to what's going on here. Can someone explain ?

Hmm, it's just occurred to me that I need to manually
export the symbols using the dllexport stuff. I suspect
that's the problem.

-- 
Regards

Steve Collyer
Netspinner Ltd


More information about the CMake mailing list