Solved Undefined reference gps_open
-
Hi. I have a Qt project where I am trying to add the header and source files from gpsd-3.16.tar.gz to my project so that I can access the GPSD daemon. So far in my Qt project I have added:
gps.h
gpsd_config.h
libgpsmm.h
libgpsmm.cppWhen I Build the project I get an undefined reference erron on several functions including gps_open which is in libgpsmm.cpp.
I have seen a post which proposes adding a linker flag like LDFLAGS =+ "-lgps", but I dont know, if this is correct, and if so, how to add this flag in Qt.
Any help greatly appreciated. Cheers Paul.
-
@Simplexity How did you add those files? Can you show your pro file?
-
@jsulm Hey thanks. Actually just sussed the problem out. To link to gps you add the following line to the .pro file:
QMAKE_LFLAGS += -lgps
As these are my first posts to the Qt forum, how do you close a thread and mark it as fixed? Ciao.
-
@Simplexity Click on "Topic Tools" and then "Mark as solved"
-
Hi,
It should rather be
LIBS += -lgps
.