I am trying to make a simple CPU temp program in QT for Linux, but I cannot get libsensors
to work with my project. As soon as I include the sensors/sensors.h and try to call int err = sensors_init(NULL);
the compiler throws an error undefined reference to 'sensors_init'
. I believe this is a linking issue, but I cannot solve it.
Edit:
I can fix the problem if I manually compile outside of QT creator with g++ -o main main.cpp -lsensors
.
Now my question is how do I pass the -lsensors
parameter to the g++ compiler in the QT creator. I am using qmake.