LLRP integration with QT giving error "Skipping incompatible /path/libltkcpp.a when searching for -lltkcpp"

182 views Asked by At

I am writing an application on QT Creator with C++ to read RFID tags via LLRP protocol.

I am using the example.cpp as provided in the llrp.org site, while trying to compile the code it is throwing the following error -

:-1: error: /home/project/RFID/lib/libltkcpp.a: Timestamp out of range; substituting 1970-01-01 05:30:00
:-1: error: skipping incompatible /home/project/RFID/lib//libltkcpp.a when searching for -lltkcpp
:-1: error: cannot find -lltkcpp
:-1: error: skipping incompatible /home/project/RFID/lib//libxml2.a when searching for -lxml2
:-1: error: collect2: error: ld returned 1 exit status

I have added the libraries - libltkcpp.a, libltkcpp_r.lib, libxml2.a to my project. Still the issues are coming. Any ideas what is going wrong here?

The development environment is 64bit CentOS.

1

There are 1 answers

0
p-a-o-l-o On BEST ANSWER

First off, you need a pro file that looks like this:

CONFIG -= qt
CONFIG -= app_bundle

SOURCES += \
    /some-path-to-the-example/example1.cpp

LIBS += -L/some-path-to-the-libraries -lltkcpp -lxml2
INCLUDEPATH  += /some-path-to-the-library-headers

Then, either you make a new Qt Creator Kit where you use linux-g++-32 as the Qt mkspec, and configure the project to use it;

or, as an alternative, use an existing kit, but add -spec linux-g++-32 as an additional argument to qmake, in the project Build Steps.

Run qmake, rebuild, and the linker issues should be gone.

Yet you could face some compiler complaints about missing headers, in which case you're very likely in need of 32 bits development libraries installed.

On Ubuntu, the task is done installing the gcc-7-multilib and the g++-7-multilib packages.

About CentOS, I really don't know for sure. I hope this red hat related post will help you through.