FLTK logo

Re: [fltk.general] Re: FLTK msys2 initial step fails

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: FLTK msys2 initial step fails Albrecht Schlosser Nov 24, 2021  
 
On 11/24/21 10:10 PM Greg Ercolano wrote:
On 11/24/21 11:25 AM, Mark Olesen wrote:
Mark J Olesen@DESKTOP-64I0KOO MINGW64 ~/opensource/fltk
$ make
[..]
=== making src =""> make[1]: Entering directory '/home/Mark J Olesen/opensource/fltk/src'
Compiling Fl.cxx...
In file included from Fl.cxx:22:
../FL/platform.H:51:14: fatal error: X11/Xlib.h: No such file or directory
   51 | #    include <X11/Xlib.h>
      |              ^~~~~~~~~~~~
compilation terminated.

    Having trouble replicating here, using a fresh install of msys2 + fltk cloned from git
    on Windows 8. (I see you used Win10, but I wouldn't think it'd matter).

    Sails right through the build of fltk-1.4.x freshly cloned from github.
    (I think you haven't mentioned which version of FLTK you're using, so I'm
    to assume the current master from git)

    Perhaps the devil's in the details of how you installed msys2?


Yes I think that's the case. The "problem" with MSYS2 is that there are several "personalities" of the build tools, one for MSYS itself (you MUST NOT use that one) and one for Windows (MinGW) 32-bit and 64-bit. You can use one of the latter, I'm using the 64-bit versions.


    In my case:

        1) I followed steps 1 through 7 on this page: https://www.msys2.org/

        2) Not sure why, but 'git' was not part of the 'base-devel' install in step 7 above,
           so I had to install it with: pacman -S git

        3) Cloned fltk, cd'ed into the directory and ran 'make':

                git clone https://github.com/fltk/fltk.git fltk-1.4.x.git
                cd
fltk-1.4.x.git
                make

    This automatically ran autogen, ran configured, and then started building FLTK.


I think step 7 is the key:

$ pacman -S --needed base-devel mingw-w64-x86_64-toolchain

This does obviously install the correct toolchain (mingw-w64-x86_64). Unfortunately I don't have a log of my installation available.


@Mark: you wrote:

> Are we missing some Windows flag to the compiler? It does not appear to 
> be defining a Windows macro. So, platform.H thinks it is unix.

Exactly. Your gcc output does not contain the required _WIN32 macro because this gcc "personality" is obviously for building MSYS programs. For comparison, this is from my MSYS2 installation:

$ pacman -Qs | grep gcc   # lists the installed gcc compiler
local/gcc-libs 10.2.0-1 (msys2-devel)
local/mingw-w64-x86_64-gcc 10.3.0-5 (mingw-w64-x86_64-toolchain)
local/mingw-w64-x86_64-gcc-ada 10.3.0-5 (mingw-w64-x86_64-toolchain)
local/mingw-w64-x86_64-gcc-fortran 10.3.0-5 (mingw-w64-x86_64-toolchain)
local/mingw-w64-x86_64-gcc-libgfortran 10.3.0-5 (mingw-w64-x86_64-toolchain)
local/mingw-w64-x86_64-gcc-libs 10.3.0-5 (mingw-w64-x86_64-toolchain)
local/mingw-w64-x86_64-gcc-objc 10.3.0-5 (mingw-w64-x86_64-toolchain)
local/mingw-w64-x86_64-libgccjit 10.3.0-5 (mingw-w64-x86_64-toolchain)
    GNU Compiler Collection (libgccjit) for MinGW-w64

$ which g++
/mingw64/bin/g++

$ g++ -dM -E -x c++ - < /dev/null | grep WIN32
#define __WIN32__ 1
#define _WIN32 1
#define WIN32 1
#define __WIN32 1

This shows that the required _WIN32 macro is defined here.

Mark, please try to follow the instructions Greg showed above and I believe you should get the correct toolchain installed and your Msys2/MinGW installation should be able to build FLTK for a standard Windows environment.

--
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/6b2fbd78-cbd6-f630-2652-e5efefe21f90%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'.