简体   繁体   中英

Compile libssh with msvc for x64

First of all, I'm not an expert in build libraries from the source with cmake and all this stuff. But unfortunately I have to. I followed up the steps mention in the INSTALL document of the libssh and read a few archived mails but nothing helps me out. It sounds so easy on the web, but I didn't bring it to work. Here is what I've done so far:

  • Download source from (Version 0.7.5) from libssh git
  • As mentioned in INSTALL file, download and install cmake (Version 3.9.1)
  • As mentioned in INSTALL file, download and install OpenSSL (Version 1.0.2)
  • Ignore zlib, because its optional

Everything is installed in the default paths. Now starts cmake-gui.exe and set source code to …/src folder and binaries to …/build folder, press 'Configure' button, with Visual Studio 12 2013 Win64. Now the first error is generated: install Library TARGETS given no DESTINATION . Okay, checks make file which use variable LIB_INSTALL_DIR to set the path, in my case the path is empty. Add item to cmake-gui named LIB_INSTALL_DIR with path to ../build dir.

Fine, configuration works, generate works, open project works. Try to build 'ALL_BUILD' ends up in error: C1083: Cannot open include file: 'config.h': No such file or directory . Searched my whole disk for the file, nothing found. I believe cmake have to generate this file, guessing right? Or is this file missing? Hope someone can help me out! Or maybe have a link to an already compiled lib? Doesn't understand why libssh doesn't offers a download, x64 is quite normal today.

Initial inspiration is often the right one, the missing config.h is normally generated by cmake.

If you using cmake-gui.exe, it expects an path to the source, heading is 'Where is the source code:'. I thought this means the path to the source code files, which are located under …/src , but this is wrong. I need to the set the path to the root folder, in my case and everything works like a charm.

Also need to change back to OpenSSL version 1.0.2, because somewhere around 30 function declarations has changed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM