Re: порядок аргументов gcc

Anatoly Pugachev <[email protected]>
Newsgroups gmane.linux.debian.user.russian
Message-ID <CADxRZqysJCa+4HiCBYgY5C-C11ijfRZ+TvRAe4=KZKAQu5Ma3g@mail.gmail.com>
On Fri, Sep 4, 2020 at 1:12 PM sergio <[email protected]> wrote:
>
>
> % gcc -lusb usbtest.c
> /usr/bin/ld: /tmp/cckKmWxL.o: in function `main':
> usbtest.c:(.text+0x5): undefined reference to `usb_init'
> collect2: error: ld returned 1 exit status
> zsh: exit 1     gcc -lusb usbtest.c
> % gcc usbtest.c -lusb
> %
>
> Забавно, но это не у одного меня так:

https://stackoverflow.com/questions/45135/why-does-the-order-in-which-libraries-are-linked-sometimes-cause-errors-in-gcc
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.