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


Groups > linux.debian.user > #224714

Re: Bullseye: Linker Can't Find libgps Library

From Charles Curley <charlescurley@charlescurley.com>
Newsgroups linux.debian.user
Subject Re: Bullseye: Linker Can't Find libgps Library
Date 2020-07-12 23:50 +0200
Message-ID <ArS1c-8h4-3@gated-at.bofh.it> (permalink)
References <ArPZn-76x-11@gated-at.bofh.it> <ArQsq-7vW-15@gated-at.bofh.it>
Organization occasionally

Show all headers | View raw


On Sun, 12 Jul 2020 22:04:54 +0200
Sven Joachim <svenjoac@gmx.de> wrote:

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

Bingo. 

charles@white:~/versioned/gpsclient$ gcc -Wall -o gpsclient gpsclient.c -lm -lgps
gpsclient.c:72:2: warning: #warning Setting up for API version 9.0 [-Wcpp]
   72 | #warning Setting up for API version 9.0
      |  ^~~~~~~
charles@white:~/versioned/gpsclient$ 

Worked correctly. Thank you. Interesting.

This is a change from Buster, gcc (Debian 9.3.0-14) 9.3.0 versus gcc
(Debian 8.3.0-6) 8.3.0. I conjecture the reason is so that gcc can
accommodate multiple source files on one line, each with their own
libraries. Something like:

gcc -Wall -o snark foo.c -la -lb -lc bar.c -lb -lc -ld

-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/

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