multiple definition of 'getopt_long_only'
Florian Weimer
fweimer@redhat.com
Fri Jun 6 06:30:50 GMT 2025
* 赵爱南:
> I am a glibc developer. Now I use gcc 10.30 + glibc 2.34 compile Spec2006(version 1.2) 445 has an
> error,
>
> lib/libc.a(getopt1.o): in function 'getopt_long_only':
> glibc-2.34/posix/getopt1.c:multiple definition of 'getopt_long_only'; utils/getopt1.o:first defined here.
Please check with the SPEC documentation if this is a known erratum.
There is probably a way to use the system version of getopt.
Linking dynamically, not statically, will work around this issue.
Thanks,
Florian
More information about the Libc-alpha
mailing list