我想在Qt中使用libssh库,我的os是ubuntu18.04。
因此,我克隆了库的文件,并试图用cmake构建它。我在安装文件夹中遵循了教程,但是构建过程无法完成。
一开始我犯了一个错误:
Could NOT find CMocka (missing: CMOCKA_LIBRARIES CMOCKA_INCLUDE_DIR)**我用了rm CMakeCache.txt和cmake,在那之后使用了make。这是可以的,但当我使用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我该怎么办?
在构建过程之后,是否存在与qt有关的问题?因为它显然找不到libssh的函数!
发布于 2020-07-12 06:52:48
`file INSTALL cannot copy file`
"/home/heydari.f/libssh-mirror/build/libssh.pc" to
"/usr/local/lib/pkgconfig/libssh.pc"
这是权限问题。使用sudo make install来解决这个问题。sudo将根权限授予命令。小心使用。
** error: undefined reference to 'ssh_session_is_known_server'**
undefined reference通常意味着您试图访问某个东西,在本例中是一个找不到的函数。这个函数属于libssh,因此它意味着您没有安装libssh-dev,或者您给出了错误的库路径。因为后者是非常不可能的,我将假设libssh缺失了。在Ubuntu上,您可以使用以下命令安装它:
sudo apt install openssh-server libssh-devhttps://stackoverflow.com/questions/62857452
复制相似问题