mingw-targeted cross-compiler question

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

mingw-targeted cross-compiler question

gviewer
Hello, I downloaded a software and tried to compile it on cygwin, I got an error message:

"gcc: The -mno-cygwin flag has been removed; use a mingw-targeted cross-compiler."

I checked the Make file, it used this flag:
gcc -mno-cygwin -g -Wl,--add-stdcall-alias -Wl,--export-all-symbols ...

What should I use exactly to replace the '-mno-cygwin' flag? Thanks a lot.
Reply | Threaded
Open this post in threaded view
|

Re: mingw-targeted cross-compiler question

NightStrike
On Wed, Dec 15, 2010 at 2:41 PM, gviewer <[hidden email]> wrote:

>
> Hello, I downloaded a software and tried to compile it on cygwin, I got an
> error message:
>
> "gcc: The -mno-cygwin flag has been removed; use a mingw-targeted
> cross-compiler."
>
> I checked the Make file, it used this flag:
> gcc -mno-cygwin -g -Wl,--add-stdcall-alias -Wl,--export-all-symbols ...
>
> What should I use exactly to replace the '-mno-cygwin' flag? Thanks a lot.

You can install the windows cross compilers that are provided as
cygwin packages.  You can pick ones that target either 64-bit windows
or 32-bit windows.

--
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

Reply | Threaded
Open this post in threaded view
|

Re: mingw-targeted cross-compiler question

gviewer
My cygwin may already install that package, then how to modify the flag in Makefile to compile.


NightStrike wrote
On Wed, Dec 15, 2010 at 2:41 PM, gviewer <marlonmin@gmail.com> wrote:
>
> Hello, I downloaded a software and tried to compile it on cygwin, I got an
> error message:
>
> "gcc: The -mno-cygwin flag has been removed; use a mingw-targeted
> cross-compiler."
>
> I checked the Make file, it used this flag:
> gcc -mno-cygwin -g -Wl,--add-stdcall-alias -Wl,--export-all-symbols ...
>
> What should I use exactly to replace the '-mno-cygwin' flag? Thanks a lot.

You can install the windows cross compilers that are provided as
cygwin packages.  You can pick ones that target either 64-bit windows
or 32-bit windows.

--
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
Reply | Threaded
Open this post in threaded view
|

Re: mingw-targeted cross-compiler question

NightStrike
On Wed, Dec 15, 2010 at 3:50 PM, gviewer <[hidden email]> wrote:
>
> My cygwin may already install that package, then how to modify the flag in
> Makefile to compile.

That depends on the makefile.  Usually, there's a user-settable
variable called CFLAGS that you can use to customize things.  But
basically, with the cross compiler, you call a canonically named
executable instead of the normal one.  So for instance, to compile for
64-bit windows, instead of:

gcc -mno-cygwin  file.c

you would use:

x86_64-w64-mingw32-gcc  file.c

Make sense?

--
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

Reply | Threaded
Open this post in threaded view
|

Re: mingw-targeted cross-compiler question

gviewer
Thanks for explanation.  I checked the Make file, and here it is:

CFLAGS = -O3 -Wimplicit
...
gcc -mno-cygwin -g -Wl,--add-stdcall-alias -Wl,--export-all-symbols ${BRILL_INCLUDES} -I ${JAVA_HOME}/include/ -I ${JAVA_HOME}/include/win32 -shared -o lib/BTagger.dll ${BRILL_JAVA_BASE}/*.c ${BRILL_SRC}

This is a Java wrapper around a C/C++ library. Can you help have a look and see if there is an easy change to the "gcc -mno-cygwin ..." part? I am using Windows 7 64-bit machine.
Thanks.


NightStrike wrote
On Wed, Dec 15, 2010 at 3:50 PM, gviewer <marlonmin@gmail.com> wrote:
>
> My cygwin may already install that package, then how to modify the flag in
> Makefile to compile.

That depends on the makefile.  Usually, there's a user-settable
variable called CFLAGS that you can use to customize things.  But
basically, with the cross compiler, you call a canonically named
executable instead of the normal one.  So for instance, to compile for
64-bit windows, instead of:

gcc -mno-cygwin  file.c

you would use:

x86_64-w64-mingw32-gcc  file.c

Make sense?

--
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
Reply | Threaded
Open this post in threaded view
|

Re: mingw-targeted cross-compiler question

NightStrike
On Wed, Dec 15, 2010 at 4:10 PM, gviewer <[hidden email]> wrote:

>
> Thanks for explanation.  I checked the Make file, and here it is:
>
> CFLAGS = -O3 -Wimplicit
> ...
> gcc -mno-cygwin -g -Wl,--add-stdcall-alias -Wl,--export-all-symbols
> ${BRILL_INCLUDES} -I ${JAVA_HOME}/include/ -I ${JAVA_HOME}/include/win32
> -shared -o lib/BTagger.dll ${BRILL_JAVA_BASE}/*.c ${BRILL_SRC}
>
> This is a Java wrapper around a C/C++ library. Can you help have a look and
> see if there is an easy change to the "gcc -mno-cygwin ..." part? I am using
> Windows 7 64-bit machine.
> Thanks.

Well, like I said.. install the cross compiler package and edit that
line to say what you need it to say.

--
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

Reply | Threaded
Open this post in threaded view
|

Re: mingw-targeted cross-compiler question

gviewer
Yes, That problem got solved. But now I got a new problem:
"fatal error, jni.h, no such file or directory"

The jni.h is included in a .h c file.

What's going on?


NightStrike wrote
On Wed, Dec 15, 2010 at 4:10 PM, gviewer <marlonmin@gmail.com> wrote:
>
> Thanks for explanation.  I checked the Make file, and here it is:
>
> CFLAGS = -O3 -Wimplicit
> ...
> gcc -mno-cygwin -g -Wl,--add-stdcall-alias -Wl,--export-all-symbols
> ${BRILL_INCLUDES} -I ${JAVA_HOME}/include/ -I ${JAVA_HOME}/include/win32
> -shared -o lib/BTagger.dll ${BRILL_JAVA_BASE}/*.c ${BRILL_SRC}
>
> This is a Java wrapper around a C/C++ library. Can you help have a look and
> see if there is an easy change to the "gcc -mno-cygwin ..." part? I am using
> Windows 7 64-bit machine.
> Thanks.

Well, like I said.. install the cross compiler package and edit that
line to say what you need it to say.

--
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
Reply | Threaded
Open this post in threaded view
|

Re: mingw-targeted cross-compiler question

Xu,Chiheng
On Thu, Dec 16, 2010 at 6:03 AM, gviewer <[hidden email]> wrote:
>
> Yes, That problem got solved. But now I got a new problem:
> "fatal error, jni.h, no such file or directory"
>
> The jni.h is included in a .h c file.
>
> What's going on?
>
>

make JAVA_HOME="C:\Program Files\Java\jdk1.5.0_22"

or

JAVA_HOME="C:\Program Files\Java\jdk1.5.0_22"
export JAVA_HOME
make






--
Chiheng Xu
Wuhan,China

--
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

Reply | Threaded
Open this post in threaded view
|

Re: mingw-targeted cross-compiler question

Xu,Chiheng
>
> make JAVA_HOME="C:\Program Files\Java\jdk1.5.0_22"
>
> or
>
> JAVA_HOME="C:\Program Files\Java\jdk1.5.0_22"
> export JAVA_HOME
> make

correction:
JAVA_HOME='C:\Program Files\Java\jdk1.5.0_22'
JAVA_HOME=`cygpath -m ${JAVA_HOME}`
export JAVA_HOME
make  CC=x86_64-w64-mingw32-gcc






--
Chiheng Xu
Wuhan,China

--
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

Reply | Threaded
Open this post in threaded view
|

Re: mingw-targeted cross-compiler question

Frédéric Bron
In reply to this post by gviewer
> 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édéric

--
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

Reply | Threaded
Open this post in threaded view
|

Re: mingw-targeted cross-compiler question

NightStrike
2010/12/16 Frédéric Bron <[hidden email]>:
>> 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édéric

What do you mean by not supported?  JonY maintains the cross compilers....

--
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

Reply | Threaded
Open this post in threaded view
|

Re: mingw-targeted cross-compiler question

Charles Wilson-2
On 12/16/2010 7:55 AM, NightStrike wrote:

> 2010/12/16 Frédéric Bron <...>:
>>> 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édéric
>
> What do you mean by not supported?  JonY maintains the cross compilers....
>

I think Frédéric just mis-stated: he was referring to 'gcc -mno-cygwin'
as "the cross compiler" which it really isn't, and never was.  It just
acted /almost/ like one.

The mingw64-{i686,x86_64} cross compilers are certainly supported, but
they do require configuring with --host={i686,x86_64}-w64-mingw32 (or,
in some cases, explicitly setting $CC) which is somewhat different that
the old procedure using 'gcc{-3} -mno-cygwin'; this difference can be
confusing to some users.

However, I have to point out the obvious: i686-w64-mingw32-gcc does
*not* produce the same code that a hypothetical cygwin 'gcc-4
-mno-cygwin' would, because cygwin's gcc would use the mingwrt and
w32api runtime headers and libs, not the mingw64's corresponding runtime
headers and libs.  The ITP'ed mingw-gcc cross compiler *would* be the
equivalent of 'gcc-4 -mno-cygwin' once it is accepted.

However, users like the OP would be free to use any of the three
mingw-ish cross compilers, with perfectly valid results.  In many ways,
the mingw64- offerings have more thorough support for the complete
w32api...but the (still unofficial) mingw cross compiler is compatible
with the mingw.org offerings...

--
Chuck

--
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

Reply | Threaded
Open this post in threaded view
|

Re: mingw-targeted cross-compiler question

Frédéric Bron
In reply to this post by NightStrike
>>> 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édéric
>
> What do you mean by not supported?  JonY 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?

Frédéric

--
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

Reply | Threaded
Open this post in threaded view
|

Re: mingw-targeted cross-compiler question

Michael Lemke
On Wed, 22 Dec 2010 14:13:15 +0100, Frédéric Bron <[hidden email]>  
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édéric
>>
>> What do you mean by not supported?  JonY 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  -m32 x.c

but get

x.c:35:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before  
'WinMain'

and that also for all other option combinations that made sense to me.

Thanks,
Michael


--
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

Reply | Threaded
Open this post in threaded view
|

Re: mingw-targeted cross-compiler question

Kai Tietz-2
2010/12/22  <[hidden email]>:

> On Wed, 22 Dec 2010 14:13:15 +0100, Frédéric Bron <[hidden email]>
> 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édéric
>>>
>>> What do you mean by not supported?  JonY 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  -m32 x.c
>
> but get
>
> x.c:35:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before
> '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  (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.

Regards,
Kai


--
|  (\_/) This is Bunny. Copy and paste
| (='.'=) 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

Reply | Threaded
Open this post in threaded view
|

Re: mingw-targeted cross-compiler question

Michael Lemke
On Wed, 22 Dec 2010 15:11:18 +0100, Kai Tietz <[hidden email]>  
wrote:

> 2010/12/22  <[hidden email]>:
>> On Wed, 22 Dec 2010 14:13:15 +0100, Frédéric Bron  
>> <[hidden email]>
>> 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édéric
>>>>
>>>> What do you mean by not supported?  JonY 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  -m32 x.c
>>
>> but get
>>
>> x.c:35:13: error: expected '=', ',', ';', 'asm' or '__attribute__'  
>> before
>> '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  (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 <windows.h>

int STDCALL WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int  
nShow) {
    return 0;
}


  orion> i686-w64-mingw32-gcc -mwindows -m32 xx.c
xx.c:4:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before  
'WinMain'
  orion> gcc-3 -mno-cygwin -mwindows -m32 xx.c
  orion>

Thanks,
Michael


--
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

Reply | Threaded
Open this post in threaded view
|

Re: mingw-targeted cross-compiler question

Kai Tietz-2
2010/12/22  <[hidden email]>:

> On Wed, 22 Dec 2010 15:11:18 +0100, Kai Tietz <[hidden email]>
> wrote:
>
>> 2010/12/22  <[hidden email]>:
>>>
>>> On Wed, 22 Dec 2010 14:13:15 +0100, Frédéric Bron <[hidden email]>
>>> 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édéric
>>>>>
>>>>> What do you mean by not supported?  JonY 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  -m32 x.c
>>>
>>> but get
>>>
>>> x.c:35:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before
>>> '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  (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 <windows.h>
>
> int STDCALL WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int
> nShow) {
>   return 0;
> }
>
>
>  orion> i686-w64-mingw32-gcc -mwindows -m32 xx.c
> xx.c:4:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before
> 'WinMain'
>  orion> gcc-3 -mno-cygwin -mwindows -m32 xx.c
>  orion>
>
> Thanks,
> Michael
>
>
> --
> 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
>
>

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

--
|  (\_/) This is Bunny. Copy and paste
| (='.'=) 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

Reply | Threaded
Open this post in threaded view
|

Re: mingw-targeted cross-compiler question

NightStrike
In reply to this post by Frédéric Bron
2010/12/22 Frédéric Bron <[hidden email]>:

>>>> 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édéric
>>
>> What do you mean by not supported?  JonY 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?

Basically, "stuff from mingw-w64.sf.net"

The middle piece of the triplet is the vendor tag.  We at mingw-w64
are the vendors.  We support win32 and win64, for both host and
target.  I admit it's confusing, but we didn't come up with a better
name fast enough.

--
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

Reply | Threaded
Open this post in threaded view
|

Re: mingw-targeted cross-compiler question

Andy Koppe
On 22 December 2010 15:12, NightStrike wrote:

> 2010/12/22 Frédéric Bron:
>>>>> 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édéric
>>>
>>> What do you mean by not supported?  JonY 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?
>
> Basically, "stuff from mingw-w64.sf.net"
>
> The middle piece of the triplet is the vendor tag.  We at mingw-w64
> are the vendors.  We support win32 and win64, for both host and
> target.  I admit it's confusing, but we didn't come up with a better
> name fast enough.

Also, the 'mingw32' in the OS part of the triplet is hystorical
ballast. The '32' in there doesn't mean anything (anymore), and a
better name would have been plain 'mingw' or even just 'windows'.
Alas, compatibility concerns have stopped any change.

Andy

--
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

Reply | Threaded
Open this post in threaded view
|

Re: mingw-targeted cross-compiler question

NightStrike
On Wed, Dec 22, 2010 at 10:35 AM, Andy Koppe <[hidden email]> wrote:

> On 22 December 2010 15:12, NightStrike wrote:
>> 2010/12/22 Frédéric Bron:
>>>>>> 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édéric
>>>>
>>>> What do you mean by not supported?  JonY 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?
>>
>> Basically, "stuff from mingw-w64.sf.net"
>>
>> The middle piece of the triplet is the vendor tag.  We at mingw-w64
>> are the vendors.  We support win32 and win64, for both host and
>> target.  I admit it's confusing, but we didn't come up with a better
>> name fast enough.
>
> Also, the 'mingw32' in the OS part of the triplet is hystorical
> ballast. The '32' in there doesn't mean anything (anymore), and a
> better name would have been plain 'mingw' or even just 'windows'.
> Alas, compatibility concerns have stopped any change.

You should be able to safely drop the 32 at the very least with recent
versions of config.*

I thought we changed most things to check for mingw* instead of mingw32.

--
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

12