【发布时间】:2016-09-17 02:45:28
【问题描述】:
我正在尝试在我的代码 (libssh) 中包含一个库,但没有任何效果... 在这一点上,我不确定该怎么做,因为搜索引擎中没有针对我收到的错误弹出任何结果。
我在这里下载了 libssh: https://github.com/substack/libssh
我安装了这些:
yum install cmake zlib-devel libpng-devel openssl-devel -y;
创建了一个“build”目录作为 libssh 的父目录,移到那里,输入以下内容:
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ..
make
[root@ build]# cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug LD_DEBUG=all ..
-- Could NOT find NaCl (missing: NACL_LIBRARIES NACL_INCLUDE_DIRS)
-- ********************************************
-- ********** libssh build options : **********
-- zlib support: ON
-- libgcrypt support: OFF
-- libnacl support: OFF
-- SSH-1 support: OFF
-- SFTP support: ON
-- Server support : ON
-- GSSAPI support : ON
-- Pcap debugging support : ON
-- With static library: OFF
-- Unit testing: OFF
-- Client code Unit testing: OFF
-- Public API documentation generation
-- Benchmarks: OFF
-- ********************************************
-- Configuring done
-- Generating done
-- Build files have been written to: /root/libssh/build
然后它失败了......
Scanning dependencies of target exec
[ 2%] Building C object examples/CMakeFiles/exec.dir/exec.c.o
[ 5%] Building C object examples/CMakeFiles/exec.dir/authentication.c.o
[ 8%] Building C object examples/CMakeFiles/exec.dir/knownhosts.c.o
[ 11%] Building C object examples/CMakeFiles/exec.dir/connect_ssh.c.o
Linking C executable exec
/usr/bin/ld: cannot find -lssh_shared
collect2: ld a retourné 1 code d'état d'exécution
make[2]: *** [examples/exec] Erreur 1
make[1]: *** [examples/CMakeFiles/exec.dir/all] Erreur 2
make: *** [all] Erreur 2
有人知道问题出在哪里吗? “找不到 -lssh_shared”在谷歌上没有显示任何相关内容。
【问题讨论】: