On Sat, 8 Feb 2020 at 06:29, Mark Olesen wrote:
>
> I am running msys from
msys2.org
>
> pacman -S mingw-w64-x86_64-toolchain
>
> cmake -DCMAKE_TOOLCHAIN_FILE=../../w64_toolchain.cmake -DCMAKE_BUILD_TYPE=Release ..
Hi Mark et al,
This post is just for clarity, and in case others stumble across this
thread, as I'm assuming most will know this, but it is worth noting
that when you install Msys2 it actually installs, 3 distinct
"personalities".
These are mingw32, mingw64 and msys. Each with its own shell.
The mingw32 config is intended for building "native" Win32
executables, in 32-bit mode. Mingw64 is "the same" but for 64-bit
builds.
The msys personality isn't really for building on Windows as such - it
is a cygwin-like posix emulation that the msys2 folks use for tools
porting and so on. I think you *can* use it to build stuff, but the
msys2 folks themselves suggest that if you want the posix layer, you
are better off using cygwin...
FWIW, I tried to build fltk under the msys personality, and that did
not go well...
The mingw32 and mingw64 versions both built the fltk-1.4 repo for me
just fine, configuring with cmake in the usual way. The resulting
binaries run fine on stock Windows boxes.
TBH, I don't use the msys2 toolchain much myself (I find it to be a
faff to install all the bits...) but I have been using the msys2
mingw32 tools a bit recently because it provides a much more recent
gcc (9.0.2 IIRC) than what my usual mingw toolchain provides...
As regards the compiler, you pretty much need to install the specific
version for the personality you are wanting to use.
I have gcc installed 3 times, in effect, in my msys2 config. I have no
idea if this is normal, it certainly doesn't seem very "efficient" to
me!
So I used pacman from the msys2 shell to install gcc,
Then from the mingw32 shell I used pacman to install mingw-w64-i686-gcc.
Finally from the mingw64 shell I installed mingw-w64-x86_64-gcc.
See what I mean about it being a faff to set everything up right...
There are a mess of other packages that you need to install "per
personality" too, AFAIK, and I do not recall what they all are. It's
not something I really relish revisiting...
Anyway; once I got the per-personality toolchains all up up running,
since then it has pretty much Just Worked, and pacman seems to do a
good job of keeping it all up to date and everything. It all seems to
work pretty well, once you get on top of the 3 different parallel
installations, as it were.
It's not what I generally use for my fltk-on-Windows work, but when I
have used it (typically the msys2-mingw32 mode) it has been absolutely
fine, so I'm not entirely sure what it is that Mark has hit.
An unrelated aside; the gcc-9 seems to build quite a bit slower than
the older gcc I use in my usual mingw32 setup, and it can be quite
"chatty" about what it finds in my code. I guess it is being a lot
more thorough. I can't tell if the resulting binary is any the better
for it however!
--
Ian