X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2173E3898539 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1608263158; bh=DS5nbLgjQIls/IM7CRY3GBY10hxRgj/O462PihdfGfQ=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Pgnno8nehUnI0MIA9zOVNFeL6g+kyQKlnsc0kWgptd3upfOWNWaoBj5cLnpna5rnW l91/8VWK5TyqUe5a1VDvplAZkQYHJqpvgLGJMOLFmCmyumVx42EZUQ6NV3NSl81oyZ eqM/3Dj7auYggltfGLbI6MTZlrqSRTUZ0D8J9lT0= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 98C953898523 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ZjZdVq20ubVqAgY367yOUYjBiaV5hz0IjAmUzTdZU/E=; b=p+EM9muD63K1C86S3nn4SXKYs06ztQYLio5hFUIjYXsXOzb1AEmTM/q8gzYLCiYASa cR6yybful50vNfDZfz33F1hBJGGJuNqqG+MnG8XwSGLh4zunBLzi29GiVgoxzrqO9eqQ jB5ormVz4d5bsQWHLD1idKIIIcg2mVhqESaPQ8LcRLExhjLSwbRCwWoIoOrD0I1M1GPz +HUo8dco2kOVNX1ie0aY2x4Y7bSs8FEne9qeBiA4m+83dVswHEUWtqzZ0QyAm+Bi6edl nYo4IOZRwtwK00OADyixmRdyD7itGtkoP6qD8lPLVaKiOFLWLXSdJbnre71TC1YeJ+05 U9jg== X-Gm-Message-State: AOAM530TfGdgOldTVd9oGXcW53NafLeLYgIpx1GSJFXafusdoaunR77x 2FYSgVsLUPvwT6s5jTL1TDb5yF0R2DAQaxDBd52CJWyABLQ= X-Google-Smtp-Source: ABdhPJyNn04aGxa2qEMRlSNUjQLav1G4OwLZwnlhSxAzXEmr8ZnPT/EGd51g5h8q0Bouc6nwhYF3/E/TjogFuVBfNFQ= X-Received: by 2002:ac8:148f:: with SMTP id l15mr2141889qtj.130.1608263156067; Thu, 17 Dec 2020 19:45:56 -0800 (PST) MIME-Version: 1.0 Date: Fri, 18 Dec 2020 03:45:55 +0000 Message-ID: Subject: why does i686-w64-mingw32-gcc -static fail? To: cygwin AT cygwin DOT com X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: Lee via Cygwin Reply-To: Lee Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "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 -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple