X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: References: <30467239 DOT post AT talk DOT nabble DOT com> Date: Wed, 22 Dec 2010 15:36:01 +0100 Message-ID: Subject: Re: mingw-targeted cross-compiler question From: Kai Tietz To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 2010/12/22 : > On Wed, 22 Dec 2010 15:11:18 +0100, Kai Tietz > wrote: > >> 2010/12/22 =A0: >>> >>> On Wed, 22 Dec 2010 14:13:15 +0100, Fr=E9d=E9ric Bron >>> wrote: >>> >>>>>>> I checked the Make file, it used this flag: >>>>>>> gcc -mno-cygwin -g -Wl,--add-stdcall-alias -Wl,--export-all-symbols >>>>>>> ... >>>>>> >>>>>> replace gcc by gcc-3 >>>>>> gcc 4 is now the default on cygwin but the cross compiler is not >>>>>> supported for that version. >>>>>> Fr=E9d=E9ric >>>>> >>>>> What do you mean by not supported? =A0JonY maintains the cross >>>>> compilers.... >>>> >>>> I meant that i686-w64-mingw32-gcc exists but not i686-w32-mingw32-gcc. >>>> I thought that w64 meant "built on win64" and mingw32 "run binary on >>>> win32". >>>> So it seems to me that with cygwin running on a 32 bit windows, it is >>>> not possible to cross compile to win32. However with a 64 bit windows >>>> you can produce win32 applications. >>>> However, I just tried to use i686-w64-mingw32-g++ on my win32 machine >>>> with a hello world program and it produces an binary that can be used >>>> from windows on that win32 machine. >>>> So my question to the list: what is the meaning of w64 in the name? >>> >>> Well, I don't know but I'd really like to know what is the replacement >>> these days for >>> >>> gcc -mno-cygwin -mwindows x.c >>> >>> I tried >>> >>> i686-w64-mingw32-gcc -mwindows =A0-m32 x.c >>> >>> but get >>> >>> x.c:35:13: error: expected '=3D', ',', ';', 'asm' or '__attribute__' be= fore >>> 'WinMain' >>> >>> and that also for all other option combinations that made sense to me. >>> >>> Thanks, >>> Michael >> >> Hi, >> >> the -w64- within cross-compiler's triplet means that this compiler >> uses mingw-w64 runtime headers and libraries. The architecture part of >> triplet (i686|x86_64) makes the difference, if a cross-compiler >> produces binaries for i686 (means 32-bit), or for x86_64 =A0(means >> 64-bit) windows native. >> Btw the -m32 is superflous for the i686-w64-mingw32 cross-compiler, as >> it just produces 32-bit and has no 64-bit capabilities builtin. >> Could you show please your x.c file, as the message you get is a >> compiler error already. I would assume that you missed to include some >> header, or you were defining something which cause here the harm. > > Well, the program compiles just fine with the old gcc-3 -mno-cygwin but > anyway, here's a stripped down version: > > > #define WINVER 0x0500 > #include > > int STDCALL WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int > nShow) { > =A0 return 0; > } > > > =A0orion> i686-w64-mingw32-gcc -mwindows -m32 xx.c > xx.c:4:13: error: expected '=3D', ',', ';', 'asm' or '__attribute__' befo= re > 'WinMain' > =A0orion> gcc-3 -mno-cygwin -mwindows -m32 xx.c > =A0orion> > > Thanks, > Michael > > > -- > Problem reports: =A0 =A0 =A0 http://cygwin.com/problems.html > FAQ: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 http://cygwin.com/faq/ > Documentation: =A0 =A0 =A0 =A0 http://cygwin.com/docs.html > Unsubscribe info: =A0 =A0 =A0http://cygwin.com/ml/#unsubscribe-simple > > Well, the issue is STDCALL. We don't define this macro. Sorry, can find a single hint on that in msdn. Use here instead the standard WINAPI and it builds on all compilers you are using. Regards, Kai --=20 |=A0 (\_/) This is Bunny. Copy and paste | (=3D'.'=3D) Bunny into your signature to help | (")_(") him gain world domination -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple