代码改变世界

在Visual Studio 2013中编译libssh2项目

2014-09-07 14:45  每天努力一点点  阅读(827)  评论(0编辑  收藏  举报


一. 下载需要的外部包,并解压,下面给出的链接如果无法访问,就google搜索下载一下:
•下载
openssl
•下载zlib

二、修改libssh2项目配置:
1.C/C++->General->Additional Include Directories,增加 ‘openssl路径\include‘.
2.C/C++->Preprocessor->Preprocessor Definitions,增加 ‘LIBSSH2_LIBRARY‘.
3.Librarian->General,output file设置为Debug_lib\libssh2.lib

三、修改tests项目配置:

1.Linker->General,output file设置为Debug\tests.exe
2.Linker->General->Additional Library Directories,增加:

1)‘openssl路径\lib‘
2)‘zlib路径\static32‘,如果时64机器,就选择mulustatic64(注意这个目录下的 ‘zlibstat.lib’ 修改为 ‘zlib.lib’ )

3) libssh2.lib路径,‘.\Debug_lib‘.

3.C/C++->Preprocessor->Preprocessor,删除‘LIBSSH2_WIN32‘