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

Archive Index This month's Index

Subject: Re: Compiling libssh2 under x64 with Visual Studio 2010

Re: Compiling libssh2 under x64 with Visual Studio 2010

From: Nick Pateman <nick.pateman_at_certivox.com>
Date: Mon, 17 Sep 2012 13:48:21 +0000

Hi there,

They aren't CURL errors, they are libssh2 errors, I just have the source in a folder named libCurl_X64 or whatever lol.

Thankfully I've managed to get around needing libSSH2, the article I was reading was misleading so I'm all sorted now. Sorry for any confusion caused with the path names!

Thanks for your help.

Nick.

------------------------------

Message: 3
Date: Mon, 17 Sep 2012 10:54:59 +0100
From: Alexander Lamaison <swish_at_lammy.co.uk>
To: libssh2 development <libssh2-devel_at_cool.haxx.se>
Subject: Re: Compiling libssh2 under x64 with Visual Studio 2010
Message-ID:
        <CADyPeTPRnc59Th6GnyM_egq2W-qnEudCTqPrT=ZoyQYL1jH4oQ_at_mail.gmail.com>
Content-Type: text/plain; charset=windows-1252

On 17 September 2012 10:32, Nick Pateman <nick.pateman_at_certivox.com> wrote:
> Hi there,
> I?m trying to compile libssh2 under x64 on Visual Studio 2010 but am
> not having much luck at the moment.
>
> I added the curl include path to the configuration which eliminates
> the missing curl.h references. Then unfortunately I get 2229 errors.

Are you sure you're trying to compile libssh2? Or are you maybe trying to compile libcurl? libssh2 doesn't depend on curl.h so there won't be any references to it to eliminate.

> Many thanks in advance for any help. I?ve put an excerpt of some of
> the errors below?
>
> Error 201 error C2081: 'key_exchange_state_t' : name in formal
> parameter list illegal
> c:\pop\libcurl_x64\libssh2-1.4.2\libssh2-1.4.2\src\libssh2_priv.h 1010
> 1 libssh2

I've no idea why it would object to key_exchange_state_t as it's defined in the same file. Something in your build is very broken.
Have you got the correct libssh2_config.h in you include path? The one from the win32 directory?

Alex

--
Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org)
------------------------------
Message: 2
Date: Mon, 17 Sep 2012 12:18:55 +0200
From: Peter Stuge <peter_at_stuge.se>
To: libssh2-devel_at_cool.haxx.se
Subject: Re: Compiling libssh2 under x64 with Visual Studio 2010
Message-ID: <20120917101855.18560.qmail_at_stuge.se>
Content-Type: text/plain; charset=us-ascii
Nick Pateman wrote:
> It says I need to compile OpenSSL, zLib and libSSH2.
> I've got the other 2 compiling just fine but this one I'm stuck on.
And you're using separate projects for each package?
//Peter
------------------------------
Message: 3
Date: Mon, 17 Sep 2012 11:24:10 +0100
From: Alexander Lamaison <swish_at_lammy.co.uk>
To: libssh2 development <libssh2-devel_at_cool.haxx.se>
Subject: Re: Compiling libssh2 under x64 with Visual Studio 2010
Message-ID:
	<CADyPeTOd9xs9w=aO5m+9Yduaa9N=Uj5FzZe0uCvT5Si2M0mbHQ_at_mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
On 17 September 2012 11:15, Nick Pateman <nick.pateman_at_certivox.com> wrote:
>
> What I'm trying to do is compile libCurl for x64 via the following instructions...
>
> http://curl.haxx.se/mail/lib-2010-06/0232.html
>
> It says I need to compile OpenSSL, zLib and libSSH2.  I've got the other 2 compiling just fine but this one I'm stuck on.
Ok, that's fine but why are you getting curl.h errors when compiling libssh2?  Curl uses libssh2, not the other way round.
> I basically just opened with VC6 project that was in the source folder and updated it to VS2010 format via the wizard.
My advice is to ignore the included VC projects and make your own because it's really easy on Windows.  Here's the guide I've sent around this list a few times now:
Using Visual Studio:
- Shove all the .c files in libssh2/src into an empty Win32 C++ (DLL or Static Library) project except libgcrypt.c/openssl.c of which you only pick the one appropriate to your crypto library.
- Add your OpenSSL or libgcrypt include directory to the project include path
- Add libssh2/include to the project include path
- Add libssh2/win32 to the project include path
- Add the appropriate crypto libraries to the project Additonal Libraries list
- Build
- Job done
Using MinGW:
I'm not confident enough to list the exact steps for this but its basically a matter of adding the same .c files to a Makefile source list and instructing gcc to make a DLL or static library from them.
Use Google to find the flags you need to add for those two alternatives.
Alternatively, Guenter advised:
there's a NMakefile available too which should work with all MSVC versions; edit .\win32\config.mk and setup the paths to OpenSSL and Zlib, then in the root: nmake
Or use the included mingw makefile:
set OPENSSL_PATH=...
if you want Zlib support:
set WITH_ZLIB=1
set ZLIB_PATH=...
in ./win32 folder: mingw32-make
HTH
Alex
--
Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org)
------------------------------
Message: 4
Date: Mon, 17 Sep 2012 13:18:01 +0200
From: Peter Stuge <peter_at_stuge.se>
To: libssh2-devel_at_cool.haxx.se
Subject: Re: Compiling libssh2 under x64 with Visual Studio 2010
Message-ID: <20120917111801.23340.qmail_at_stuge.se>
Content-Type: text/plain; charset=us-ascii
Alexander Lamaison wrote:
> Here's the guide I've sent around this list a few times now:
Thanks! Maybe put it on the wiki, or commit to a text file?
//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2012-09-17

the libssh2 team