FLTK logo

Re: [fltk.general] Re: Compiling under mingw - error with zlib.h

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Re: Compiling under mingw - error with zlib.h Albrecht Schlosser Nov 16, 2022  
 
On 11/16/22 15:29 'pvr...@btinternet.com' via fltk.general wrote:

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".

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.

Hint: you can search for a particular tool/package name, e.g. 'make' with:

$ pacman -Ss make | grep x86_64

There are a lot of different packages with similar names (for different build scenarios) which makes it so hard to find the correct packages for your MSYS2 installation. :-(

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.

FWIW, I just tried Ninja on my system:

$ /mingw64/bin/cmake -G Ninja ../.. -DOPTION_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++"

... and it worked for me, building "native" Windows applications with one exception (see notes).

Notes:

1. "/mingw64/bin/cmake": I had to use the explicit path (I have both the MSYS2 and a Windows CMake installed and for an obscure reason pure `cmake` starts the Windows version).

2. All system image libs (jpeg, png, zlib) are disabled.

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 shall persevere. Phil.

Yes, I think you're on a good way. Maybe the only thing is to install the remaining package (see above).


--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/89fe0acc-f2a5-7eff-273c-ab99de6d9c3c%40online.de.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.