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

Stanislav Maslovski <[email protected]>
Newsgroups gmane.linux.debian.user.russian
Message-ID <20200904092619.GA32106@kaiba>
п■п╬п╠я─п╬пЁп╬ п╡я─п╣п╪п╣п╫п╦ я│я┐я┌п╬п╨,

On Fri, Sep 04, 2020 at 12:01:00PM +0300, sergio wrote:
> gcc -lusb file.c
> я─п╟п╫я▄я┬п╣ я─п╟п╠п╬я┌п╟п╩п╬, п╟ я┌п╣п©п╣я─я▄ я─я┐пЁп╟п╣я┌я│я▐ п╫п╟ undefined reference п╦ п╫п╟п╢п╬ пЁп╬п╡п╬я─п╦я┌я▄
> gcc file.c -lusb
> п╖я┌п╬ п©я─п╬п╦п╥п╬я┬п╩п╬ п╦ я┤я┌п╬ п©п╬п╪п╣п╫я▐п╩п╬я│я▄?

п п╟п╨п╟я▐ п╡п╣я─я│п╦я▐ gcc?

% gcc --version
gcc (Debian 8.3.0-6) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There
is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

% gcc usbtest.c -lusb
% gcc -lusb usbtest.c
% cat usbtest.c      
#include <usb.h>

int main()
{
  usb_init();
  return 0;
}
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.