ffttyy
ffttyy

Reputation: 864

QT, undefined reference to `alpr::Alpr::~Alpr()'

I am trying to run OpenALPR on QT. I installed it here. I can test it from terminal successfully. I got the error in the title on QT. Undefined reference error is caused by unlinked library but I add the libopenalpr.so under the path /usr/lib to the .pro file. Why I get that error?

My cpp file:

#include "alpr.h"
int main()
{
    alpr::Alpr openalpr("us", "etc/openalpr/openalpr.conf");
}

My pro file:

QT += core
QT -= gui
TARGET = OpenAlprTry
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
LIBS += -L -lopenalpr

Upvotes: 1

Views: 647

Answers (2)

Eligijus Pupeikis
Eligijus Pupeikis

Reputation: 1125

You can use pkg-config to link with your wanted library. Add to .pro file:

unix: CONFIG += link_pkgconfig
unix: PKGCONFIG += openalpr

Package name could be different or you could need to add more packages.

To check pkg-config names type in your terminal:

pkg-config --list-all | grep openalpr

and add packages like that

unix: PKGCONFIG += package1 package2 package3

Upvotes: 3

Som
Som

Reputation: 195

Can you first check whether openalpr library is in the library path? IF not add the library path to the .pro file.

Upvotes: 0

Related Questions