www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

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

RE: Patches for Windows, Wincng, Visual Studio

From: Bob Kast <bob_2824_at_hotmail.com>
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")
#endif

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
those
> pragma comments?
> Don't they need to go into wincng.h in order to be picked up for dependent
> projects?
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2014-05-19

the libssh2 team