Re: Compiling for Windows [Was: argv revisited]



Thank you Lucas, for submitting this post. MXE seems very interesting and I
feel compelled to do some more research into it.

On 5/2/2016 at 3:36 AM, Lucas Levrel <llevrel yahoo fr> wrote:
(copy to OP in case he's already unsubscribed, apologies for duplication 
if he's not)

Le 30 avril 2016, Andrew Robinson a écrit :
Now my new problem I had was either locating a Win32 version of GTK+
greater
than v3.18 or locating a version of libglib.dll greater than v2.40. It
isn't
going to happen. The GTK+ project itself does not support Win32 or Win64,
expecting the developer to install MSYS2 and then ... nothing. The GTK+
project gives no further instructions on what to do next. Getting the Linux
binaries for GTK+ in MSYS2 seems easy, but I don't want the Linux binaries,
I
want the Windows binaries. I would compile my own binaries for Windows but
there is little reliable and complete information out there on how to do it
and what is there isn't credible. From what I understand, compiling
binaries
for Win32 is a very time consuming and tedious project, so I knew if I had
any
problems compiling it, I would not receive any help from the GTK+ (or
probably
even the GNOME) community in resolving them.

I'm not an expert programmer and when I wanted to compile for Windows the 
software I developped in Linux, I couldn't achieve a satisfactory result 
(using the -mwin32 or -mwindows flag gave either a clumsy additional 
command window, or yielded an antivirus alert!).

Then I found MinGW Cross Env, now called MXE (http://mxe.cc/). It compiled 
my project with no effort at all. When you install it, it compiles the 
cross-compiler and the libs you want, so this takes quite long, but with 
no user intervention. Then all you have to do is add such lines in your 
Linux-ready Makefile:

# prepend all binaries with a later-defined prefix
PKG_CONFIG=$(CROSS)pkg-config
CXX=$(CROSS)g++
LD=$(CROSS)ld
AR=$(CROSS)ar
STRIP=$(CROSS)strip
..
# define the prefix in the rules targeting Windows
myrule : CROSS=/path/to/bin/i686-pc-mingw32-
myrule : ...

HTH

-- 
Lucas Levrel



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]