[FFmpeg-devel] Fix libssh static linkage on Windows

Nicolas George george at nsup.org
Wed Feb 5 15:04:05 CET 2014

Le septidi 17 pluviôse, an CCXXII, Matt Oliver a écrit :
> Currently unless told to do otherwise libssh.h will automatically set all
> declarations to dllimport linkage. This means it is not possible to link
> against libssh statically. Previously I dont think this has been a problem
> as due to libssh's cmake it creates shared libraries by default. But if you
> manually specify static linking it is currently not possible to link on
> Windows.
> This patch fixes this by simply adding a define before the inclusion of the
> libssh header file that disables automatically setting dllimport. With this
> static linkage will work. Shared linkage still works as the shared lib
> (libssh.dll.a etc.) is still included during linking and so the dllimport
> are handled explicitly there instead.
> This is a single line patch that allows for both static and shared linage
> to now work with libssh on Windows. Tested with MinGW and msvc/icl. This
> patch has no affect on any other platforms.

I do not know anything about linking on windws. Are you saying that these
"dllimport" are useless and harmful? If so, what is the stance of upstream
about it?


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140205/9a12ef1f/attachment.asc>

More information about the ffmpeg-devel mailing list