Author Topic: Question: How do you build the windows binary on linux?  (Read 113 times)

Doctor Nick

  • Posts: 11
Question: How do you build the windows binary on linux?
« on: August 12, 2017, 03:12:27 PM »
I'm getting these errors when trying to compile the windows binary on Ubuntu 16.04:
Code: [Select]
make -f Makefile.xming
i686-w64-mingw32-g++ -O2 -fno-strict-aliasing -Wall -DWIN32 -Ilua_src -Iglbsp_src -Iajpoly_src -Iphysfs_src -Ilib_win32/fltk-1.3.3 -Ilib_win32/zlib-1.2.8 -o obj_win32/main.o -c gui/main.cc
In file included from gui/main.cc:22:0:
gui/hdr_fltk.h:26:19: fatal error: FL/Fl.H: No such file or directory
compilation terminated.
Makefile.xming:112: recipe for target 'obj_win32/main.o' failed
make: *** [obj_win32/main.o] Error 1

It looks like you have a custom library directory for building the windows binaries "lib_win32", how do I set that up?
« Last Edit: August 13, 2017, 11:33:10 PM by andrewj »

andrewj

  • Developer
  • *****
  • Posts: 1519
Re: [QUESTION] How do you build the windows binary on linux?
« Reply #1 on: August 12, 2017, 06:18:08 PM »
(I don't think this topic does belongs here in the Bug Reports section -- I will probably move it to the general forum)

Two libraries are needed for the Win32 version, FLTK and ZLIB.  Currently Makefile.xming refers to FLTK 1.3.3 and ZLIB 1.2.8 versions (see FLTK_DIR and ZLIB_DIR in Makefile.xming for where they are expected to be).  FLTK 1.3.4 should work too, but I haven't tested that.

To compile ZLIB, I copied win32/Makefile.gcc to win32/Makefile.xming and made two changes:
(1) set PREFIX=i686-w64-mingw32-
(2) removed everything from the "all" target except $(STATICLIB)

The Oblige file INSTALL.txt documents how I cross-compile FLTK to win32 (see MISCELLANEOUS NOTES at the end).