I am trying to compile the latest from scratch under MSYS/MINGW64.
The mingw64 installation has system zlib. The compile fails as this has ZLIB_VERNUM = 0x12d0 wheras FLTK PNG requires 0x12b0.
I have tried to run Cmake with OPTION_USE_SYSTEM_OFF=OFF and it still fails.
I have moved the MINGSW zlib.h out of the way and it fails not being able to find zlib.h as if the include library is still looking in the mingw64 directory rather than in the fltk files.
In my MINGW window I gave run
git clone https://github.com/fltk/fltk.git
mkdir -p build/Debugcd build/Debugcmake -G "Unix Makefiles" -D 'CMAKE_BUILD_TYPE=Debug' -DCMAKE_SYSTEM_NAME="Windows" -DOPTION_USE_SYSTEM_ZLIB=OFF -DOPTION_USE_SYSTEM_LIBJPEG=OFF -DOPTION_USE_SYSTEM_LIBPNG=OFF ../..make
and it fails in make. After compiling fltk_zlib and fltk_jpeg it fails on the first png file.
I found the order of the defines to be sigificant - setting zLIB after the other two was ignored and the mingsw zlib found instead.
On 15 November 2022, at 17:44, Albrecht Schlosser <Albrech...@online.de> wrote:
>
>
>On 11/15/22 17:01 'pvr...@btinternet.com' via fltk.general wrote:
>
>I am trying to compile the latest from scratch under MSYS/MINGW64.
>
>Isn't this "MSYS2" ? Just to be clear that this is (not) a typo.
A typo.
>
>The mingw64 installation has system zlib. The compile fails as this has ZLIB_VERNUM = 0x12d0 wheras FLTK PNG requires 0x12b0.
>
>I have tried to run Cmake with OPTION_USE_SYSTEM_OFF=OFF and it still fails.
>
>I have moved the MINGSW zlib.h out of the way and it fails not being able to find zlib.h as if the include library is still looking in the mingw64 directory rather than in the fltk files.
>
>In my MINGW window I gave run
>
>git clone https://github.com/fltk/fltk.git
>
>mkdir -p build/Debug
>
>cd build/Debug
>
>cmake -G "Unix Makefiles" -D 'CMAKE_BUILD_TYPE=Debug' -DCMAKE_SYSTEM_NAME="Windows" -DOPTION_USE_SYSTEM_ZLIB=OFF -DOPTION_USE_SYSTEM_LIBJPEG=OFF -DOPTION_USE_SYSTEM_LIBPNG=OFF ../..
>
>make
>
>and it fails in make. After compiling fltk_zlib and fltk_jpeg it fails on the first png file.
>
>This *should* work if your build system is set up correctly. I just tried the slightly modified commands (the first command is one long line):
>/mingw64/bin/cmake -G "Unix Makefiles" -D 'CMAKE_BUILD_TYPE=Debug' -DCMAKE_SYSTEM_NAME="Windows" -DOPTION_USE_SYSTEM_ZLIB=OFF -DOPTION_USE_SYSTEM_LIBJPEG=OFF -DOPTION_USE_SYSTEM_LIBPNG=OFF ../..
>make -j3
>... and this worked fine for me.
This has actually shown up I have a bigger problem. It can't find <FL/Fl.H>.
>If this doesn't work for you then you can try to use -G "MinGW Makefiles" instead. This needs "mingw32-make" instead of simple "make" to run the build. Can you please try this and report if it makes a difference?
>
No difference. Given the above problem, I'll reinstall msys2 tomorrow.
>I found the order of the defines to be sigificant - setting zLIB after the other two was ignored and the mingsw zlib found instead.
>
>If you mean the CMake options then the order should NOT be significant. Please check your syntax again. I see several typos (like "OPTION_USE_SYSTEM_OFF=OFF" in your post, so maybe there was one in your commands as well ? (just guessing)
I triple checked it at the time.
>
>--
Phil.
>You received this message because you are subscribed to the Google Groups "fltk.general" group.
>To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral...@googlegroups.com.
>To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/7aa1dfba-e514-3d4f-8e43-3d192b6294e1%40online.de.
On 15 November 2022, at 21:41, "'pvrose' via fltk.general" <fltkg...@googlegroups.com> wrote:
>
>
>On 15 November 2022, at 17:44, Albrecht Schlosser <Albrech...@online.de> wrote:
>
>>
>>
>>On 11/15/22 17:01 'pvr...@btinternet.com' via fltk.general wrote:
>>
>>I am trying to compile the latest from scratch under MSYS/MINGW64.
>>
>>Isn't this "MSYS2" ? Just to be clear that this is (not) a typo.
>
>A typo.
>>
>>The mingw64 installation has system zlib. The compile fails as this has ZLIB_VERNUM = 0x12d0 wheras FLTK PNG requires 0x12b0.
>>
>>I have tried to run Cmake with OPTION_USE_SYSTEM_OFF=OFF and it still fails.
>>
>>I have moved the MINGSW zlib.h out of the way and it fails not being able to find zlib.h as if the include library is still looking in the mingw64 directory rather than in the fltk files.
>>
>>In my MINGW window I gave run
>>
>>git clone https://github.com/fltk/fltk.git
>>
>>mkdir -p build/Debug
>>
>>cd build/Debug
>>
>>cmake -G "Unix Makefiles" -D 'CMAKE_BUILD_TYPE=Debug' -DCMAKE_SYSTEM_NAME="Windows" -DOPTION_USE_SYSTEM_ZLIB=OFF -DOPTION_USE_SYSTEM_LIBJPEG=OFF -DOPTION_USE_SYSTEM_LIBPNG=OFF ../..
>>
>>make
>>
>>and it fails in make. After compiling fltk_zlib and fltk_jpeg it fails on the first png file.
>>
>>This *should* work if your build system is set up correctly. I just tried the slightly modified commands (the first command is one long line):
>>/mingw64/bin/cmake -G "Unix Makefiles" -D 'CMAKE_BUILD_TYPE=Debug' -DCMAKE_SYSTEM_NAME="Windows" -DOPTION_USE_SYSTEM_ZLIB=OFF -DOPTION_USE_SYSTEM_LIBJPEG=OFF -DOPTION_USE_SYSTEM_LIBPNG=OFF ../..
>>make -j3
>>... and this worked fine for me.
>
>This has actually shown up I have a bigger problem. It can't find <FL/Fl.H>.
>>If this doesn't work for you then you can try to use -G "MinGW Makefiles" instead. This needs "mingw32-make" instead of simple "make" to run the build. Can you please try this and report if it makes a difference?
>>
>
>
Sorry it said "MinGW Makefiles" wasn't available.
>>I found the order of the defines to be sigificant - setting zLIB after the other two was ignored and the mingsw zlib found instead.
>>
>>If you mean the CMake options then the order should NOT be significant. Please check your syntax again. I see several typos (like "OPTION_USE_SYSTEM_OFF=OFF" in your post, so maybe there was one in your commands as well ? (just guessing)
>
>I triple checked it at the time.
>>
>>--
>
>Phil.
>>You received this message because you are subscribed to the Google Groups "fltk.general" group.
>>To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral...@googlegroups.com.
>>To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/7aa1dfba-e514-3d4f-8e43-3d192b6294e1%40online.de.
>
>--
>You received this message because you are subscribed to the Google Groups "fltk.general" group.
>To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral...@googlegroups.com.
>To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/usya8vlhleku611o4wle8dfn.1668548465836%40email.android.com.
I am trying to compile the latest from scratch under MSYS/MINGW64.
I have reinstalled MYSYS2 and using MINGW64 terminal:
pacman -S mingw-w64-x86_64-gcc
pacman -S mingw-w64-x86_64-cmake
pacman -S mingw-w64-x86_64-gdb
pacman -S git
cd /c/users/pvros/
cd dev
git clone https://github.com/fltk/fltk.git
cd fltk
mkdir -p build/Debug
cd build/Debug
cmake -DCMAKE_BUILD_TYPE=Debug -DOPTION_USE_SYSTEM_ZLIB=OFF ../..
ninja
Now gets me a bit further.
cmake -G offered me many more targets, but when I tried "MinGW Makefiles" got:
$ cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug ../..
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CME_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/pvros/dev/fltk/build/Debug/CMakeFiles/CMakeOutput.log".
$ mingw32-make --version GNU Make 4.3 Built for Windows32 ...
$ pacman -S mingw64/mingw-w64-x86_64-makewhich installs the 64-bit version of `mingw32-make`. Or maybe you need another package, I'm not sure. It's definitely one of the packages I have installed.
$ pacman -Ss make | grep x86_64
So I went with the default: Ninja
I now fail at:
$ ninja
[556/582] Generating fast_slow.cxx, fast_slow.h
FAILED: test/fast_slow.cxx test/fast_slow.h C:/Users/pvros/dev/fltk/build/Debug/test/fast_slow.cxx C:/Users/pvros/dev/fltk/build/Debug/test/fast_slow.h
cmd.exe /C "cd /D C:\Users\pvros\dev\fltk\build\Debug\test && C:\Users\pvros\dev\fltk\build\Debug\bin\fluid-cmd.exe -c C:/Users/pvros/dev/fltk/test/fast_slow.fl"
[560/582] Linking CXX executable bin\test\radio.exe
Where it appears to have stopped.
I shall persevere. Phil.
It appears I had installed an incompatible version of cmake.I have reinstalled MYSYS2 and using MINGW64 terminal:pacman -S mingw-w64-x86_64-gcc
pacman -S mingw-w64-x86_64-cmake
pacman -S mingw-w64-x86_64-gdb
pacman -S git
cmake -G offered me many more targets, but when I tried "MinGW Makefiles" got:$ cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug ../..
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CME_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/pvros/dev/fltk/build/Debug/CMakeFiles/CMakeOutput.log".
So I went with the default: Ninja
I now fail at:$ ninja
[556/582] Generating fast_slow.cxx, fast_slow.h
FAILED: test/fast_slow.cxx test/fast_slow.h C:/Users/pvros/dev/fltk/build/Debug/test/fast_slow.cxx C:/Users/pvros/dev/fltk/build/Debug/test/fast_slow.h
cmd.exe /C "cd /D C:\Users\pvros\dev\fltk\build\Debug\test && C:\Users\pvros\dev\fltk\build\Debug\bin\fluid-cmd.exe -c C:/Users/pvros/dev/fltk/test/fast_slow.fl"
[560/582] Linking CXX executable bin\test\radio.exeWhere it appears to have stopped.
You seem to miss `mingw32-make`. Please try this command (output from my system):
$ mingw32-make --version GNU Make 4.3 Built for Windows32 ...
3. CMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++": make sure you don't need these DLL's
4. Remaining issue: unfortunately the build (still) depends on `libwinpthread-1.dll => /mingw64/bin/libwinpthread-1.dll` as output by `ldd`
Point 4 is something I need to investigate because it makes the executables depend on this DLL. You can either run the programs from your MSYS shell or copy the DLL to the binary directory side by side with the executables if you want to run these programs under pure Windows.
I’ve manage to compile and run the demo – thanks – further comments in-line.
Phil
Sent from Mail for Windows
From: Albrecht Schlosser
Sent: 16 November 2022 15:36
To: fltkg...@googlegroups.com
Subject: Re: [fltk.general] Re: Compiling under mingw - error with zlib.h
You seem to miss `mingw32-make`. Please try this command (output from my system):
$ mingw32-make --version
GNU Make 4.3
Built for Windows32
...
If it issues "command not found" then that's probably the cause. I believe you can install it with:
$ pacman -S mingw64/mingw-w64-x86_64-make
which installs the 64-bit version of `mingw32-make`. Or maybe you need another package, I'm not sure. It's definitely one of the packages I have installed.
<PVR> I missed an important step which was to update MSYS2 after installing it – run:
pacman -Suy
I managed to get ‘-G “MinGW Makefiles”’ to work, ‘-G “MSYS Makefiles”’ still doesn’t find the generator.
</PVR>
On Wednesday, 16 November 2022 at 15:36:19 UTC Albrecht Schlosser wrote:
You seem to miss `mingw32-make`. Please try this command (output from my system):
$ mingw32-make --version GNU Make 4.3 Built for Windows32 ...
I've generally found "MSYS Makefiles" to be fine with MSYS2/mingw64, so worth trying that first...
3. CMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++": make sure you don't need these DLL's
My mingw64 builds DO NOT need these set.
My mingw32 builds DO need these set.
I have no idea what is "normal".
Probably does no harm to have these settings enabled though?
4. Remaining issue: unfortunately the build (still) depends on `libwinpthread-1.dll => /mingw64/bin/libwinpthread-1.dll` as output by `ldd`
Point 4 is something I need to investigate because it makes the executables depend on this DLL. You can either run the programs from your MSYS shell or copy the DLL to the binary directory side by side with the executables if you want to run these programs under pure Windows.
That's linked against winpthread rather than using Win32 native threads?That's.... unexpected... and not what we would want.
Is it a mis-setting in the config? Or the wrong version of the mingw64 tools?Weird...
$ cmake -G Ninja -D CMAKE_BUILD_TYPE=Debug \ -D OPTION_USE_SYSTEM_LIBJPEG:BOOL=OFF -D OPTION_USE_SYSTEM_LIBPNG:BOOL=OFF \ -D OPTION_USE_SYSTEM_ZLIB:BOOL=OFF \ -D CMAKE_EXE_LINKER_FLAGS='-static-libgcc -static-libstdc++ -static' \ ../..
I’ve manage to compile and run the demo – thanks – further comments in-line.
<PVR> I missed an important step which was to update MSYS2 after installing it – run:
pacman -Suy
I managed to get ‘-G “MinGW Makefiles”’ to work, ‘-G “MSYS Makefiles”’ still doesn’t find the generator.
On 11/16/22 17:31 'Philip Rose' via fltk.general wrote:
I managed to get ‘-G “MinGW Makefiles”’ to work, ‘-G “MSYS Makefiles”’ still doesn’t find the generator.
I'd say this is OK. They work mostly the same but AFAICT "MSYS Makefiles" are *intended* to be used for building programs that are used for MSYS itself (or the MSYS DLL etc.) whereas "MinGW Makefiles" should be used for building "Windows executables". I'm not sure what flavor of build tools "Unix Makefiles" uses by default in an MSYS2 environment.
3. CMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++": make sure you don't need these DLL's
My mingw64 builds DO NOT need these set.Does "mingw64" mean MSYS2/mingw64? If yes I'd be interested to know how to setup this so we can document it for other users.
My mingw32 builds DO need these set.I assume this means classic "MinGW" where I made this experience as well.