Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #224713

Re: Bullseye: Linker Can't Find libgps Library

From Sven Joachim <svenjoac@gmx.de>
Newsgroups linux.debian.user
Subject Re: Bullseye: Linker Can't Find libgps Library
Date 2020-07-12 22:10 +0200
Message-ID <ArQsq-7vW-15@gated-at.bofh.it> (permalink)
References <ArPZn-76x-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2020-07-12 13:16 -0600, Charles Curley wrote:

> I am trying to compile a gpsd client on a i686 bullseye machine. It
> appears the compiler can find the include file for libgps, gps.h.
> However, the linker cannot find the library.
>
> gcc -Wall -ggdb -lm -lgps -o gpsclient gpsclient.c
> gpsclient.c:64:2: warning: #warning Setting up for API version 9.0 [-Wcpp]
>    64 | #warning Setting up for API version 9.0
>       |  ^~~~~~~
> /usr/bin/ld: /tmp/ccCsxl8F.o: in function `exitHandler':
> /home/charles/versioned/gpsclient/gpsclient.c:130: undefined reference to `gps_stream'
> /usr/bin/ld: /home/charles/versioned/gpsclient/gpsclient.c:131: undefined reference to `gps_close'
> /usr/bin/ld: /tmp/ccCsxl8F.o: in function `showData':
> /home/charles/versioned/gpsclient/gpsclient.c:229: undefined reference to `timespec_to_iso8601'
> /usr/bin/ld: /tmp/ccCsxl8F.o: in function `main':
> /home/charles/versioned/gpsclient/gpsclient.c:474: undefined reference to `gps_open'
> /usr/bin/ld: /home/charles/versioned/gpsclient/gpsclient.c:477: undefined reference to `gps_errstr'
> /usr/bin/ld: /home/charles/versioned/gpsclient/gpsclient.c:503: undefined reference to `gps_stream'
> /usr/bin/ld: /home/charles/versioned/gpsclient/gpsclient.c:506: undefined reference to `gps_waiting'
> /usr/bin/ld: /home/charles/versioned/gpsclient/gpsclient.c:509: undefined reference to `gps_read'
> /usr/bin/ld: /home/charles/versioned/gpsclient/gpsclient.c:515: undefined reference to `gps_stream'
> collect2: error: ld returned 1 exit status
>
> Compilation exited abnormally with code 1 at Sun Jul 12 12:11:46
>
> This compiles and runs on Buster on AMD64 architecture.

I am rather surprised that it does, for I have learned that you always
need to put libraries to link with at the end of the gcc commandline,
i.e.

gcc -Wall -ggdb -o gpsclient gpsclient.c -lm -lgps

should work.

Cheers,
       Sven

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Bullseye: Linker Can't Find libgps Library Charles Curley <charlescurley@charlescurley.com> - 2020-07-12 21:40 +0200
  Re: Bullseye: Linker Can't Find libgps Library Sven Joachim <svenjoac@gmx.de> - 2020-07-12 22:10 +0200
    Re: Bullseye: Linker Can't Find libgps Library Charles Curley <charlescurley@charlescurley.com> - 2020-07-12 23:50 +0200
      Re: Bullseye: Linker Can't Find libgps Library Sven Joachim <svenjoac@gmx.de> - 2020-07-13 20:30 +0200
        Re: Bullseye: Linker Can't Find libgps Library Charles Curley <charlescurley@charlescurley.com> - 2020-07-13 21:10 +0200

csiph-web