It needs to go into wincng.c, after the LIBSSH2_WINCNG define:
#ifdef LIBSSH2_WINCNG /* compile only if we build with wincng */
#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 [mailto:libssh2-devel-bounces_at_cool.haxx.se] On Behalf
> Of Marc Hoersken
> Sent: Monday, May 19, 2014 2:31 PM
> To: libssh2-devel_at_cool.haxx.se
> 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
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2014-05-19