首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >即使libssh-devel安装了pacman,也找不到LibSSH在msys2上。

即使libssh-devel安装了pacman,也找不到LibSSH在msys2上。
EN

Stack Overflow用户
提问于 2021-10-19 07:30:14
回答 1查看 572关注 0票数 0

我试图在Windows10OS上用libnetconf2msys2环境编译。但是我得到了一个关于libssh的连线(我猜)问题。

我已经安装了libssh libssh2 libssh-devel libssh2-develpkg-config还找到了libssh的位置:

代码语言:javascript
复制
$ pkg-config --list-all
autoopts                       AutoOpts - A semi-automated generated/library option parser
form                           formw - ncurses 6.2 add-on library
formw                          formw - ncurses 6.2 add-on library
libalpm                        libalpm - Arch Linux package management library
libcrypto                      OpenSSL-libcrypto - OpenSSL cryptography library
libmagic                       libmagic - Magic number recognition library
libpcre                        libpcre - PCRE - Perl compatible regular expressions C library with 8 bit character support
libpcre16                      libpcre16 - PCRE - Perl compatible regular expressions C library with 16 bit character support
libpcre2-16                    libpcre2-16 - PCRE2 - Perl compatible regular expressions C library (2nd API) with 16 bit character support
libpcre2-32                    libpcre2-32 - PCRE2 - Perl compatible regular expressions C library (2nd API) with 32 bit character support
libpcre2-8                     libpcre2-8 - PCRE2 - Perl compatible regular expressions C library (2nd API) with 8 bit character support
libpcre2-posix                 libpcre2-posix - Posix compatible interface to libpcre2-8
libpcre32                      libpcre32 - PCRE - Perl compatible regular expressions C library with 32 bit character support
libpcrecpp                     libpcrecpp - PCRECPP - C++ wrapper for PCRE
libpcreposix                   libpcreposix - PCREPosix - Posix compatible interface to libpcre
libpkgconf                     libpkgconf - a library for accessing and manipulating development framework configuration
libssh                         libssh - The SSH Library
libssh2                        libssh2 - Library for SSH-based communication
libssl                         OpenSSL-libssl - Secure Sockets Layer and cryptography libraries

$ pkg-config --modversion libssh
0.9.6

然后运行命令"cmake .“在……里面

libnetconf2/build

,这会产生错误:

代码语言:javascript
复制
$ cmake ..
CMake Warning at CMakeLists.txt:171 (message):
  valgrind executable not found! Disabling memory leaks tests.


-- Could NOT find CMocka (missing: CMOCKA_LIBRARIES CMOCKA_INCLUDE_DIR) (Required is at least version "1.0.1")
-- Disabling tests because of missing CMocka
-- Could NOT find Uncrustify (missing: UNCRUSTIFY) (Required is at least version "0.71")
-- OpenSSL found, required for TLS
CMake Error at /usr/share/cmake-3.21.3/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find LibSSH (missing: LIBSSH_LIBRARIES) (Required is at least
  version "0.7.1")
Call Stack (most recent call first):
  /usr/share/cmake-3.21.3/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  CMakeModules/FindLibSSH.cmake:113 (find_package_handle_standard_args)
  CMakeLists.txt:239 (find_package)


-- Configuring incomplete, errors occurred!

然后我尝试从源代码编译 libssh ,在编译和安装之后,cmake仍然找不到正确的libssh (下面是libssh编译和安装的日志):

代码语言:javascript
复制
$ make install
Consolidate compiler generated dependencies of target ssh
[ 58%] Built target ssh
Consolidate compiler generated dependencies of target libssh_scp
[ 63%] Built target libssh_scp
Consolidate compiler generated dependencies of target sshnetcat
[ 68%] Built target sshnetcat
Consolidate compiler generated dependencies of target ssh-client
[ 73%] Built target ssh-client
Consolidate compiler generated dependencies of target scp_download
[ 78%] Built target scp_download
[ 80%] Built target libsshpp
Consolidate compiler generated dependencies of target samplesshd-cb
[ 82%] Built target samplesshd-cb
Consolidate compiler generated dependencies of target senddata
[ 87%] Built target senddata
Consolidate compiler generated dependencies of target exec
[ 92%] Built target exec
Consolidate compiler generated dependencies of target libsshpp_noexcept
[ 94%] Built target libsshpp_noexcept
Consolidate compiler generated dependencies of target keygen
[ 96%] Built target keygen
Consolidate compiler generated dependencies of target samplesftp
[100%] Built target samplesftp
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/lib/pkgconfig/libssh.pc
-- Installing: /usr/local/lib/cmake/libssh/libssh-config-version.cmake
-- Installing: /usr/local/include/libssh/callbacks.h
-- Installing: /usr/local/include/libssh/libssh.h
-- Installing: /usr/local/include/libssh/ssh2.h
-- Installing: /usr/local/include/libssh/legacy.h
-- Installing: /usr/local/include/libssh/libsshpp.hpp
-- Installing: /usr/local/include/libssh/sftp.h
-- Installing: /usr/local/include/libssh/server.h
-- Installing: /usr/local/include/libssh/libssh_version.h
-- Installing: /usr/local/lib/libssh.dll.a
-- Installing: /usr/local/bin/msys-ssh-4.dll
-- Installing: /usr/local/lib/cmake/libssh/libssh-config.cmake
-- Installing: /usr/local/lib/cmake/libssh/libssh-config-noconfig.cmake

顺便说一句,LD_LIBRARY_PATH增加了:

代码语言:javascript
复制
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
EN

回答 1

Stack Overflow用户

发布于 2021-10-19 10:38:04

我已经把这个问题作为链接解决了:Libgit2 and libssh2 CMake package 'libssh2' not found

/usr/是我从源代码编译和安装libssh的前缀路径。

代码语言:javascript
复制
cmake -DLIBSSH_INCLUDE_DIRS=/usr/local/include/libssh -DLIBSSH_LIBRARIES=/usr/local/lib/ ..
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69626688

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档