Unlike libssh, which uses cmake, libssh2 forces you to use Linux-like environment even in Windows, which eventually makes you to install MSYS on your system. You can find many ways are to build libssh2 in Windows on the net, but most of them requires you to manually edit configuration files in some way.
OK, here goes the opposite…… You’ll NOT MAKE ANY CHANGES in the source code.
First, the requirements:
- MSYS
- MinGW-w64 based build. I used two variants: MinGW-builds 64bit-winthreads-SEH exception build, but TDM-GCC 64bit also works
- libssh2 source codes(of course! :P)
- Decompress the source code.
- The most important step: force to add OpenSSL and Win32 libraries OpenSSL needs on configure step, something like this:
./configure –with-libs-prefix=“/d/Components/openssl” –with-libssl-prefix=“/d/Components/z” LDFLAGS=“-L/d/Components/openssl/lib -lssl -l crypto -lgdi32 -lws2_32” - [Optional] If you’re building 64bit binary, dont forget to add –build=amd64 before LDFLAGS, like this:
./configure –with-libs-prefix=“/d/Components/openssl” –with-libssl-prefix=“/d/Components/z” –build=amd64 LDFLAGS=“-L/d/Components/openssl/lib -lssl -l crypto -lgdi32 -lws2_32” - run make and enjoy. :)
- PROFIT!
No comments:
Post a Comment