本文介绍了libgit2与libssh2和libopenssl在windows上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我之前尝试过,在完整的构建没有成功,但即使失败现在,我明显缺少的东西在Windows上(是的它的大概窗口:P)



有人可以指导我完成


  1. 找到正确的OpenSSL以使用libssh2编译

  2. 实际上是cmake /编译libssh2到libgit2因为它不断地说找不到libssh2,我很难再次建立它。

使用CMake gui对于Windows,尝试构建一个VC2015项目



我在构建libgit2时得到的错误是

 检查模块'libssh2'
包'libssh2'未找到

未找到LIBSSH2。如果安装在默认搜索路径之外,请设置CMAKE_PREFIX_PATH。

即使我把它放在每一个可能的地方,我可以认为它会看起来,设置 CMAKE_PREFIX_PATH



如果任何人在Windows上成功完成它,我会欣赏一个指针或两个,

解决方案



libgit2使用查找libssh2。



我发现在windows上使用libssh2编译libgit2最简单的方法是:关闭USE_SSH选项以防止pkg-config搜索,然后手动设置必要的变量。重要的是:

  LIBSSH2_FOUND(设为TRUE)
LIBSSH2_INCLUDE_DIRS
LIBSSH2_LIBRARY_DIRS
LIBSSH2_LIBRARIES

对于openssl也可以做类似的事情。


I’ve tried before and had little success in the full build but even that fails now and I'm obviously missing something on windows (and yes its probably windows :P)

can someone walk me through

  1. finding the correct OpenSSL to compile with libssh2
  2. actually cmake/compiling libssh2 into libgit2 cause it keeps saying cannot find libssh2 and I'm struggling to build it again.

I'm using CMake gui For windows, trying to build a VC2015 project

The error I was getting when building libgit2 is

checking for module 'libssh2'
  package 'libssh2' not found

LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.

even though I have put it in every possible place I can think it would look, and I have tried setting CMAKE_PREFIX_PATH ?

if anyone has successfully done it on windows I would appreciate a pointer or two as to what I'm doing wrong or should be doing

Thanks kindlyRobert

解决方案

libgit2 uses the cmake pkg-config module to find libssh2. The error message is probably wrong and misleading if you don't have pkg-config installed.

I've found that the easiest way to build libgit2 with libssh2 on windows is to turn off the USE_SSH option to prevent the pkg-config search, then manually set the necessary variables. The important ones are:

LIBSSH2_FOUND (set it to TRUE)
LIBSSH2_INCLUDE_DIRS
LIBSSH2_LIBRARY_DIRS
LIBSSH2_LIBRARIES

A similar thing can also be done for openssl.

这篇关于libgit2与libssh2和libopenssl在windows上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 22:51