On 6/19/25 17:32 Gonzalo Garramuño wrote:
>
> El 19/6/25 a las 12:06, david allen escribió:
>> I'm making plans to port my project to Windows. I installed Msys2. It
>> uses the Arch Linux package system. I installed the compiler package
>> and successively compiled and ran a small program. I installed
>> packages for cairo, GSL, and FLTK. However, I got a "program not
>> found" message when attempting to run fltk-config. I am wondering if
>> others have followed this path for developing on Windows and have any
>> suggestions for what might be my problem.
>
> Albrecht is probably a better source to answer this, since he does a
> lot of MingW compilation and maintains the CMake's port ...
Almost everything I could have contributed has already been written by
Mohammed, but anyway:
Using MSVC, i.e. the MS compilers, can make deployment on other Windows
systems easier (once you got it working) because the built executables
typically don't have external dependencies.
The "classic" MinGW approach produces mostly compatible (32-bit)
executables, at least if you link libstdc++ and libgcc statically (see
e.g. README.CMake.txt and/or README.Windows.txt). However, as of today,
I believe that MinGW development has stalled (their websites are down or
"don't work"), but you can probably still download and install it from
sourceforge (
https://sourceforge.net/projects/mingw/). Download a recent
(?) version of `mingw-get.exe` and launch it. This is the installer program.
MSYS2 is a newer version with many more options (see other replies).
It's very useful to build FLTK and your own executables, but programs
always seem to depend on some MSYS2 DLL's (in my experience). There are
ways to work around this, but it needs a little more effort. MSYS2 can
build 32-bit and 64-bit Windows executables. Runnig these executables on
the build system (under the correct MSYS2 environment) works fine, but
distributing them to other Windows systems may need some supporting
DLL's too.
Final notes: I don't recommend using the FLTK package provided by MSYS2.
I assume that programs built with these packages **may** depend on even
more MSYS2 DLL's - although I didn't test this. Feedback would be
appreciated. I also recommend to build FLTK and your own applications
with CMake for better cross-platform support - although I know that
others prefer using Makefiles for their apps. YMMV.