Witam,
Nie potrafię sobie poradzić z podlinkowaniem biblioteki libssh w środowisku eclipse. Wykonałem czynności podane w instrukcji (libssh):
- Download compiler cmake
- cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ..
make - make install
Następnie przekopiowałem katalog z folderu libssh "include" oraz "src" do: /usr/include/c++/6.
Gdy kompiluję program:
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <libssh.h>
#include <stdlib.h>
using namespace std;
int main() {
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
ssh_session my_ssh_session = ssh_new();
if (my_ssh_session == NULL)
exit(-1);
ssh_free(my_ssh_session);
return 0;
}
mam błędy:
1530 **** Incremental Build of configuration Debug for project 05 ****
make all
Building target: 05
Invoking: GCC C++ Linker
g++ -o "05" ./src/05.o
./src/05.o: In function main': /home/user/workspace/05/Debug/../src/05.cpp:21: undefined reference to
ssh_new'
makefile recipe for target '05' failed
/home/user/workspace/05/Debug/../src/05.cpp undefined reference to `ssh_free'
collect2: error: ld returned 1 exit status
make: *** [05] Error 1
1530 Build Finished (took 113ms)
Eclipse: Version: Neon.3 Release (4.6.3)
libssh-0.7.5
cmake-3.10.0-rc2
Pracuję na systemie ubuntu: 17.04
Będę wdzięczny za wszelką pomoc,
Max_