Subject: RE: Patches for Windows, Wincng, Visual Studio

RE: Patches for Windows, Wincng, Visual Studio

From: Bob Kast <>
Date: Mon, 19 May 2014 14:43:14 -0400

It needs to go into wincng.c, after the LIBSSH2_WINCNG define:

#ifdef LIBSSH2_WINCNG /* compile only if we build with wincng */

#ifdef _MSC_VER
#pragma comment(lib, "Bcrypt.lib")
#pragma comment(lib, "Crypt32.lib")

If it is included outside of that ifdef, then the linker will be told to
link with those libraries even though wincng is not being compiled in (not a
disaster, but not necessary).

This pragma inserts a comment record into the object file generated by the
compiler that tells the linker to add that library to the libs being linked.
Think of it more as executable code. It is not something that would go into
a header file.

> -----Original Message-----
> From: libssh2-devel [] On Behalf
> Of Marc Hoersken
> Sent: Monday, May 19, 2014 2:31 PM
> To:
> Subject: Re: Patches for Windows, Wincng, Visual Studio
> On 19.05.2014 20:11, Bob Kast wrote:
> > That would work fine for Visual Studio.
> Thanks. By the way, are you sure that wincng.c is the correct place for
> pragma comments?
> Don't they need to go into wincng.h in order to be picked up for dependent
> projects?
> _______________________________________________
> libssh2-devel
Received on 2014-05-19