关于调用 libssh2.a

C语言 码拜 8年前 (2016-02-01) 1228次浏览
#include <libssh2.h>
#include <stdio.h>
int main()
{
LIBSSH2_SESSION *session;
LIBSSH2_SFTP *sftp_session;
LIBSSH2_SFTP_HANDLE *sftp_handle;
return 0;
}
[root@gnos-x64-dev wang]# gcc -o sftp sftp.o libssh2.a
sftp.c: In function ‘main’:
sftp.c:7: error: ‘LIBSSH2_SFTP’ undeclared (first use in this function)
sftp.c:7: error: (Each undeclared identifier is reported only once
sftp.c:7: error: for each function it appears in.)
sftp.c:7: error: ‘sftp_session’ undeclared (first use in this function)
sftp.c:8: error: ‘LIBSSH2_SFTP_HANDLE’ undeclared (first use in this function)
sftp.c:8: error: ‘sftp_handle’ undeclared (first use in this function)
这是什么原因?
假如本人不是要静态库,(–在linux下解压后libssh2-1.2.9中的例子都可以运行–)
本人应该怎么利用它的环境。
本人的电脑长时间待机后,CRT与虚拟机断开,这时就连不上了,必须要重启电脑才行,这是什么原因?
解决方案:10分
结构体类型没找到,你少包含了头文件
解决方案:10分
LIBSSH2_SFTP show一下定义声明在哪
解决方案:10分
第一,本人没写过。
第二,这种库的使用应该有例子吧?假如有的话先看看例子,琢磨一下。
第三,看源码是很好的学习过程,有些人想学还看不到源码。

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明关于调用 libssh2.a
喜欢 (1)
[1034331897@qq.com]
分享 (0)