vs2013編譯ffmpeg之十四 libssh

libssh

對應ffmpeg configure選項–enable-libssh。
ShiftMediaProject上下載的。
ffmpeg-3.3 configure libssh的時候出現下面這個錯誤:

error LNK2019: 無法解析的外部符號 __imp__sftp_init,該符號在函數 _check_sftp_init 中被引用

sftp_init的定義是LIBSSH_API int sftp_init(sftp_session sftp);LIBSSH_API在libssh.h裏面定義的,LIBSSH_API要定義成空,sftp_init前面纔不會加_imp前綴。將“-DLIBSSH_STATIC”放到libssh.pc裏面的Cflags規則裏面就可以解決這個問題,下載的libssh-master的工程裏面也定義了LIBSSH_STATIC宏。

ffmpeg-3.3 configure libssh的時候出現下面的錯誤:

libgcryptd.lib(rndw32.obj) : error LNK2019: 無法解析的外部符號 __imp__GetProcessWindowStation@0,該符號在函數 __gcry_rndw32_gather_random_fast 中被引用
libgcryptd.lib(rndw32.obj) : error LNK2019: 無法解析的外部符號 __imp__GetMessagePos@0,該符號在函數 __gcry_rndw32_gather_random_fast 中被引用
libgcryptd.lib(rndw32.obj) : error LNK2019: 無法解析的外部符號 __imp__GetMessageTime@0,該符號在函數 __gcry_rndw32_gather_random_fast 中被引用
libgcryptd.lib(rndw32.obj) : error LNK2019: 無法解析的外部符號 __imp__GetClipboardOwner@0,該符號在函數 __gcry_rndw32_gather_random_fast 中被引用
libgcryptd.lib(rndw32.obj) : error LNK2019: 無法解析的外部符號 __imp__GetClipboardViewer@0,該符號在函數 __gcry_rndw32_gather_random_fast 中被引用

libssh要用到libgcryptd.lib,解決的辦法是將user32.lib加到libssh.pc裏面的Libs規則裏面。

libssh.pc

# libilbc.pc

prefix=../../contribute/MSVC/libssh-master
exec_prefix=${prefix}
libdir=${exec_prefix}/vs2013_build/lib/x86
includedir=${prefix}/vs2013_build/include

Name: libssh
Description: libssh
Version: 0.7.3
Libs: -L${libdir} libsshd.lib  libgcryptd.lib libgpg-errord.lib user32.lib -L../../contribute/MSVC/libgcrypt-master/vs2013_build/lib/x86 -L../../contribute/MSVC/libgpg-error-master/vs2013_build/lib/x86
Cflags: -DLIBSSH_STATIC -I${includedir}
發佈了49 篇原創文章 · 獲贊 7 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章