views:

32

answers:

1

I am trying to use the libfprint in my QT application

#include <QtGui/QApplication>
#include "mainwindow.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#include <libfprint/fprint.h>


int main(int argc, char *argv[])
{

int r = 1;
        struct fp_dscv_dev *ddev;
        struct fp_dscv_dev **discovered_devs;
        struct fp_dev *dev;
        struct fp_print_data *data;


        r = fp_init();


    QApplication a(argc, argv);
    MainWindow w;
    w.show();
    return a.exec();
}

Compiling throws this error /concept/main.cpp:31: undefined reference to `fp_init()' I have been battling with this for a while now. Any idea what I can do to get past this point ? Thanks in advance!

A: 

It's a problem with your linker - it cannot find necessary libraries. Did you pass necessary linker switches (something like -lfoo) instructing it to link with library you are trying to use?

el.pescado
I'm using QT Creator to the build the application. Is there a place to specify this?
Femi
Forgot to mention this - fprint.h was written in C, and using extern "C" to wrap it does not make any difference
Femi
Yes, in your .pro file. You must add something like LIBS += -lfprint
Frank