On 27.08.2018 16:30 Albrecht Schlosser wrote:
> On 27.08.2018 14:14 Julien Vernay wrote:
>>
>> I am trying to cross-compile the FTLK library from a Ubuntu system to
>> Windows 10. I am using Windows Subsystem for Linux (with Ubuntu
>> 18.04). Mingw-w64 is installed on the Ubuntu system (with apt-get). I
>> have configured CXX and CC environment variables to use mingw compiler.
>
>> When I try ./configure, I get *"error: Configure could not find
>> required X11 libraries, aborting." *.
>
> You need to tell configure if you want to cross compile, there are extra
> options --target, --host, and --build. I think --target is the key here,
> and you need to use platform "triplets" to specify the target platform.
FYI: I just managed to build FLTK (1.4.0) and many example programs (all
demo programs that don't use fluid) on my Ubuntu 14.04 system in a
Virtualbox VM under Windows 10 and I could execute the built programs
under Windows 10. I used configure and make with these commands:
$ make clean
$ LDFLAGS='-static-libgcc -static-libstdc++' ./configure
--host=x86_64-w64-mingw32
$ make -k
$ cp fluid/*.exe test/*.exe /path/to/win10/
$ cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll /path/to/win10/
This configuration builds fluid but can obviously not use this fluid.exe
to generate the sources from all test/*.fl files (you need a native
fluid program to do that). Since this was only for a test I ignored this
fact...
Notes:
(1) `make clean' does "nothing", but generates ./configure and some
essential files
(2) LDFLAGS='...' links statically with some system libs
(3) '--host=x86_64-w64-mingw32' is the host triplet of my installed
cross compiler for windows. You may want to use another config
(4) I used 'make -k' to ignore errors when fluid was used (see above)
(5) I copied *.exe to a shared file system (/path/to/win10/)
(6) I also copied the missing file libwinpthread-1.dll to this shared
file system
Now I could run the built FLTK programs on /path/to/win10/ from the
Windows 10 system (using explorer to run the executables).
So this is how it can *basically* work. YMMV, you may need to tweak the
host triplet and some other options. The missing dll can maybe be
avoided but I can't help with this right now.
I don't know if it is possible to tweak configure to use a native fluid
to build the test files. Maybe the cross-compiled fluid in your
configuration can work because you're running under Windows?
Anyway, I hope this is of any value for you and others and helps you to
get your build of FLTK going. Feedback welcome...