要給測試支持一下,在SUSE Linux上安裝libssh2,環境上有了openssl-1.0.1g和libssh2-1.8.0。linux
uname -a
還看不了發行版本。只能使用cat /etc/issue
或lsb_release -a
查看。以前沒有安裝過,因而搜索一番。linux環境編譯libssh2shell
-fPIC
參數的問題,雖解決./config的問題,但make時又報錯。沒招了,跟同事反饋了一下,給了一份簡要的指導ssh
./config --prefix=/home/openssl-1.0.1g --openssldir=/home/openssl-1.0.1g/ssl
,根據文檔裏的這個命令改爲源碼的路徑。移交給測試後,她試了一下仍是報錯。fatal error:libssh2_config.h:No such file or directory。測試
-I/src -I/include
.profile
裏export LIBSSH2_HOME=/usr/local/libssh2
,執行source .profile
後,編譯代碼路徑下的Makefile.incl.platform
就能得值,執行就OK。cd openssl-1.0.1s/ ./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl/ssl make && make install ./config shared --prefix=/usr/local/openssl --openssldir=/usr/local/openssl/ssl make clean make && make install cd libssh2-1.8.0/ ./configure --prefix=/usr/local/libssh2 --with-openssl CPPFLAGS="-I/usr/local/openssl/include" LDFLAGS="-L/usr/local/openssl/lib" make clean make && make install