Gary Allen
Gary Allen

Reputation: 1370

Configure MinGW-w64 for 32bit and 64bit Executables

I honestly have spent too long Googling this.

I would like to setup MinGW-w64 so that I can simply pass the -w32 flag in order to create a 32-bit executable, and leave it as default to create a 64-bit executable.

During the setup of MinGW-w64, I have numerous options. For Architecture there is i686 and x86_64. For exception there is dwarf, SJIJ, and SEH.

This thread here (How do I compile and link a 32-bit Windows executable using mingw-w64) suggests that only SJIJ allows the -m32 flag to be passed in order to create a 32-bit binary, however I have found conflicting information elsewhere.

How can I set up MinGW so that I can easily both 32-bit and 64-bit architectures?

Thanks

Upvotes: 3

Views: 3612

Answers (1)

Brecht Sanders
Brecht Sanders

Reputation: 7287

What I do is set up seperate MinGW-w64 toolchains, one for 32-bit and one for 64-bit Windows.

That way there is no confusion and the 2 won't ever accidentally get mixed up if some parameter is forgotten.

You can get a recent version of both toolchains from http://winlibs.com/

Upvotes: 2

Related Questions