[英]libssh's functions couldn't be found on qt and cmake error while building libssh
I want to use libssh library in Qt and my os is ubuntu 18.04.我想在 Qt 中使用 libssh 库,我的操作系统是 ubuntu 18.04。
so I cloned the library's file and tried to build it with cmake.所以我克隆了库的文件并尝试使用 cmake 构建它。 I followed the tutorial in INSTALL folder but the building process can't be completed.
我按照安装文件夹中的教程进行操作,但构建过程无法完成。
at first I had this error:起初我有这个错误:
Could NOT find CMocka (missing: CMOCKA_LIBRARIES CMOCKA_INCLUDE_DIR)**
i used rm CMakeCache.txt
and cmake
and after that make
.我使用
rm CMakeCache.txt
和cmake
,然后是make
。 that was ok, but again when I used make install
i had this error:没关系,但是当我再次使用
make install
时,我遇到了这个错误:
CMake Error at cmake_install.cmake:41 (file):
file INSTALL cannot copy file
"/home/heydari.f/libssh-mirror/build/libssh.pc" to
"/usr/local/lib/pkgconfig/libssh.pc".
Makefile:85: recipe for target 'install' failed
make: *** [install] Error 1
what should I do?我应该怎么办?
and after building process, is there anything to do with qt?在构建过程之后,与 qt 有什么关系? because it could't find libssh's functions obviously!
因为它显然找不到libssh的功能!
file INSTALL cannot copy file
"/home/heydari.f/libssh-mirror/build/libssh.pc" to
"/usr/local/lib/pkgconfig/libssh.pc"
This is a permissions issue.这是一个权限问题。 Use
sudo make install
to solve this.使用
sudo make install
来解决这个问题。 sudo
gives root privileges to a command. sudo
赋予命令 root 权限。 Use it carefully.小心使用它。
** error: undefined reference to 'ssh_session_is_known_server'**
undefined reference
usually means you are trying to access something, in this case a function, which is not found. undefined reference
通常意味着您正在尝试访问某些内容,在这种情况下是 function,但未找到。 This function belongs to libssh, so it means that either you don't have libssh-dev
installed or you are giving the path to the library incorrectly.这个 function 属于 libssh,所以这意味着您没有安装
libssh-dev
或者您错误地提供了库的路径。 Since the latter is highly unlikely, i am going to assume libssh
is missing.由于后者的可能性极小,我将假设缺少
libssh
。 On Ubuntu you can install it using following command:在 Ubuntu 上,您可以使用以下命令安装它:
sudo apt install openssh-server libssh-dev
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.