Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Undefined reference gps_open

Undefined reference gps_open

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 1.9k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Simplexity
    wrote on last edited by
    #1

    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.cpp

    When 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.

    jsulmJ 1 Reply Last reply
    0
    • S Simplexity

      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.cpp

      When 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.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Simplexity How did you add those files? Can you show your pro file?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply
      0
      • jsulmJ jsulm

        @Simplexity How did you add those files? Can you show your pro file?

        S Offline
        S Offline
        Simplexity
        wrote on last edited by
        #3

        @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.

        jsulmJ 1 Reply Last reply
        0
        • S Simplexity

          @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.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Simplexity Click on "Topic Tools" and then "Mark as solved"

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi,

            It should rather be LIBS += -lgps.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved