public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* why does i686-w64-mingw32-gcc -static fail?
@ 2020-12-18  3:45 Lee
  2020-12-18  5:29 ` Brian Inglis
  0 siblings, 1 reply; 4+ messages in thread
From: Lee @ 2020-12-18  3:45 UTC (permalink / raw)
  To: cygwin

Would someone please explain why adding "-static" makes
i686-w64-mingw32-gcc fail?

This works (or at least the compiler doesn't complain)

$ i686-w64-mingw32-gcc -o a.exe         conftest-pcre.c -lpcreposix -lpcre

This does not work

$ i686-w64-mingw32-gcc -o a.exe -static conftest-pcre.c -lpcreposix -lpcre
/usr/lib/gcc/i686-w64-mingw32/10/../../../../i686-w64-mingw32/bin/ld:
cannot find -lpcreposix
/usr/lib/gcc/i686-w64-mingw32/10/../../../../i686-w64-mingw32/bin/ld:
cannot find -lpcre
collect2: error: ld returned 1 exit status

Why does adding "-static" make it fail?

$ cat conftest-pcre.c
/* i686-w64-mingw32-gcc -o a.exe -static conftest-pcre.c -lpcreposix -lpcre
 *   and yet this works
 * i686-w64-mingw32-gcc -o a.exe         conftest-pcre.c -lpcreposix -lpcre
 */
char pcre_compile ();
char regcomp ();
int main () {
return pcre_compile ();
return regcomp ();
  ;
  return 0;
}


Thanks
Lee

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-19 16:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-18  3:45 why does i686-w64-mingw32-gcc -static fail? Lee
2020-12-18  5:29 ` Brian Inglis
2020-12-19  7:37   ` Lee
2020-12-19 16:39     ` Ken Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).