April 12, 2012

Josué V. Herrera Josué V. Herrera
Lab Rat
41 posts

[Solved] Using Third Party Library

  Hi guys, I’m using Fedora Linux and I’ve installed ne7ssh [netsieben.com] (third party library) and all it dependencies using the yum package manager, so far so good. I started playing with this library but I couldn’t go further, I receive the following error message when I try to compile:

undefined reference to `ne7ssh::ne7ssh()’ mysshclient.cpp

Here is my code:

  1. #include "mysshclient.h"
  2. #include "ui_mysshclient.h"
  3.  
  4. #include "ne7ssh.h"
  5.  
  6.  MySSHClient::MySSHClient(QWidget *parent) : QMainWindow(parent), ui(new Ui::MySSHClient)
  7. {
  8.  
  9.     ui->setupUi(this);
  10.  
  11.     ne7ssh *ssh = new ne7ssh();
  12.  
  13. }

Here is my .pro file:

  1. #-------------------------------------------------
  2. #
  3. # Project created by QtCreator 2012-04-11T21:08:08
  4. #
  5. #-------------------------------------------------
  6.  
  7. QT += core gui
  8.  
  9. TARGET = MySSHClient
  10. TEMPLATE = app
  11.  
  12. SOURCES += main.cpp \
  13.         mysshclient.cpp
  14.  
  15. HEADERS  += mysshclient.h
  16.  
  17. FORMS    += mysshclient.ui

…any clue about this?

Thanks in advance!

3 replies

April 12, 2012

Andre Andre
Robot Herder
6399 posts

I’ve moved your topic to the appropriate forum.

You need to link to the library too. You can do that from the .pro file. Reference the documentation for the LIBS variable in the QMake manual.

April 12, 2012

veeraps veeraps
Lab Rat
87 posts

Guess you missed out the third part library linkage in .PRO file.

You may have to add the third party library details as below in your .PRO file for linking.

LIBS += -L{Libraray_Path} -l{Library_Name}

~veeraps

April 12, 2012

Josué V. Herrera Josué V. Herrera
Lab Rat
41 posts
Done! Thanks both of you!
 
  ‹‹ OpenSSL undefined references      XML merger ››

You must log in to post a reply. Not a member yet? Register here!