Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 7137

getting undefined references from libssh2

$
0
0

I installed the libssh2 library on my Ubuntu linux. When compiling the C code I received this message:

undefined reference to `libssh2_session_init_ex'

I downloaded the libssh2 from their website. I followed the instructions of how to install it on my computer but It seems i am still missing soemthing.

This is my code in my make file:

all: ssh     ssh: mysshpass.c     gcc -lssh2 -g -o mysshpass mysshpass.cclean:     rm -rf mysshpass

The include part of the C code:

1 #include <stdlib.h>2 #include <libssh2.h>3 #include <libssh2_sftp.h>4 5 #include <sys/socket.h>6 #include <netinet/in.h>7 #include <arpa/inet.h>8 #include <sys/types.h>9 #include <stdio.h>10 #include <string.h>11 12 //#include <libssh2_config.h>13 14 int main(int argc, char *argv[])

Thanks very much in advance

Note :

I used this new line :

all: sshssh: mysshpass.c    gcc -g -Lusr/src/libssh2-1.4.1/include -o mysshpass mysshpass.cclean:    rm -rf mysshpass

but still same compilations errors. By the way, I was told to install the libssh2-devel also, but i have no idea how to do that.

Thanks


Viewing all articles
Browse latest Browse all 7137

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>