Building FLTK 1.3 on Windows

689 views
Skip to first unread message

aditya siram

unread,
Mar 1, 2015, 10:49:34 AM3/1/15
to fltkg...@googlegroups.com
Hi all,
Is there any community documentation on building FLTK on Windows using CMake and MinGW? Googling turned up a couple of StackOverflow articles but I was hoping for a step-by-step tutorial. I realize there's support for Visual Studio but I'm not familiar with it and I'd rather not ask users to download Visual Studio just to build a set of bindings.
Thanks!
-deech

Michael Surette

unread,
Mar 1, 2015, 11:38:49 AM3/1/15
to fltkg...@googlegroups.com
While CMake is not officially supported it does work well with FLTK.
See the README.CMake.txt in the distribution.

The main problem with the CMake build at the moment is that
fltk-config isn't useable. If you plan to use CMake as your build
system for your projects this doesn't matter. If you don't want to
use CMake as your build system the standard configure; make; make
install; should work with MinGW.

--
Mike

Ian MacArthur

unread,
Mar 1, 2015, 4:28:09 PM3/1/15
to fltkg...@googlegroups.com
On Sun Mar 01 2015 15:49:33, aditya siram wrote:
> Hi all,
> Is there any community documentation on building FLTK on Windows using CMake and MinGW? Googling turned up a couple of StackOverflow articles but I was hoping for a step-by-step tutorial. I realize there's support for Visual Studio but I'm not familiar with it and I'd rather not ask users to download Visual Studio just to build a set of bindings.

CMake works fine, though can take a bit of fiddling to get right; it’s not officially a “first-class” target for fltk.

If you just want mingw working, then get the Msys shell and the assorted dev kit you’d use anyway with mingw/Msys, and then just do the regular configure / make sequence.

Msys is adequately “posix-like” that the usual things you do on *nix generally work adequately.


I did a how-to for this a *long* time ago (getting on for a decade...) that is out of date, but still “good enough”.

http://www.fltk.org/articles.php?L598





Edzard Egberts

unread,
Mar 2, 2015, 2:15:46 AM3/2/15
to 'ed' via fltk.general
Ian MacArthur wrote:
> I did a how-to for this a *long* time ago (getting on for a
> decade...) that is out of date, but still “good enough”.
>
> http://www.fltk.org/articles.php?L598

The MinGW stuff got more easy:

www.mingw.org -> [Download Installer] (button at top right of site):

mingw-get-setup.exe 0.6.2-beta-20131004-1

Execute installer:

-> MinGW Installation Manager Packages Basic Setup:

[x] mingw-developer-toolkit (MSYS)
[x] mingw-base
[x] msys-base
[x] mingw32-gcc-g++

no ada, fortran and objc necessary

[Installation] -> [Apply Changes] installs MinGW after configuration.

Be aware, that path "c:\mingw" is recommended and don't move it.

When the installatin is completed the Windows PATH must be extended by
"c:\mingw\bin", divided by a semicolon. After that most of the IDEs like
Eclipse or DevCpp can use the installed MinGW, also the commands like
"gcc" or "g++" can be executed out of the terminal.

The installer doesn't create a link to start MSYS, so one should be
created linking to "c:\mingw\msys\1.0\msys.bat"



MacArthur, Ian (Selex ES, UK)

unread,
Mar 2, 2015, 4:27:31 AM3/2/15
to fltkg...@googlegroups.com
> > I did a how-to for this a *long* time ago (getting on for a
> > decade...) that is out of date, but still “good enough”.
> >
> > http://www.fltk.org/articles.php?L598
>
> The MinGW stuff got more easy:

This is very true; the new installer is a lot easier.

That said, I only seldom use their GUI installer, most of the time I tend to use their apt-get clone (mingw-get) instead at the Msys command line. I find that to be more straightforward in general, particularly for adding extra packages or doing upgrades etc.



> Be aware, that path "c:\mingw" is recommended and don't move it.

Hmm, I don't think I've *ever* installed mingw to the "C:" drive of any machine (though that is what they recommend!) and it's always worked fine for me.
Maybe my usage is atypical, of course, and I'm supposed to know what I'm doing so...


> The installer doesn't create a link to start MSYS, so one should be

Really?
Weird: it did for me the last time I used the GUI installer (which was, um, setting up a Win7 box last November time, I think.)




Selex ES Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

nj...@imap.cc

unread,
Mar 7, 2015, 1:44:14 PM3/7/15
to fltkg...@googlegroups.com
For instructions when building with MinGW it might be a good idea to add
that you need to mount your drive as root when using bash and make to
build fltk. Enter "mount c:/mingw /mingw" in bash and run make. Without
that it wont run. It also stopped building some of the test files
because it tried to run "man" which has to be added in your MinGW
install (package msys-man.bin).

Georg Potthast

unread,
Mar 7, 2015, 4:18:39 PM3/7/15
to fltkg...@googlegroups.com, ian.ma...@selex-es.com

The CMake site has a page about using it with FLTK: http://www.cmake.org/Wiki/CMakeForFLTK

Georg

Ian MacArthur

unread,
Mar 7, 2015, 6:41:48 PM3/7/15
to fltkg...@googlegroups.com
On Sat Mar 07 2015 18:44:11, njord wrote:
>
>
> For instructions when building with MinGW it might be a good idea to add
> that you need to mount your drive as root when using bash and make to
> build fltk. Enter "mount c:/mingw /mingw" in bash and run make. Without
> that it wont run. It also stopped building some of the test files
> because it tried to run "man" which has to be added in your MinGW
> install (package msys-man.bin).

OK; this is weird - are you talking about using mingw to cross-compile for Win32 on a Linux box?

Or are your using mingw/Cmake on a WinXX box?

Anyway:
I’ve been using mingw/Msys for building natively on Win32 hosts for a good while, probably since Win2K, and lots of WinXP and Win7 boxes.

And I’ve never had to sort the mount points; it has always just worked out fine.

And I never bother to install the man stuff either - the configure/Makefile process correctly identifies that it won’t work and carries on regardless.

Can you describe your build setup, so I can try and get my head around the problems you report hitting?







nj...@imap.cc

unread,
Mar 8, 2015, 8:41:41 AM3/8/15
to fltkg...@googlegroups.com
Ok here we go.

I'm using Win7-64.
Latest MinGW (4.8.1).
fltk 1.3.3:10609

But after checking out fltk I did run make and voila, it worked. But I
might have done a minor upgrade of mingw. And also the monthly windows
patch reboot. I'm usually on OSX these days so I dont use my windows
machine very often.

Before reboot the error was something with autoconf. It couldn't find
something. It could have been some environment stuff that updated itself
after the reboot. Who knows...

I haven't tried cmake now. I did get cmake to work before. But I had to
add some path flags about the compiler to some cmake temp file. And when
I did run make it tried to run some msvc make which I don't have and
failed. CMake might have some internal make tool. So I had to use
"mingw32-make" to compile fltk. The reboot might have fixed these errors
to :)

But I'm happy enough with make and autoconf stuff. As long it works.

Duncan Gibson

unread,
Mar 9, 2015, 4:38:56 AM3/9/15
to fltkg...@googlegroups.com
Georg Potthast wrote:
> The CMake site has a page about using it with FLTK:
> http://www.cmake.org/Wiki/CMakeForFLTK

Please remove my email address if you reply to fltk.general!

I'm afraid that I wrote that Wiki page, as a complete novice
to CMake, and it's enough for a simple project, but I was not
able to check whether it worked across platforms, just Linux.

If you want anything fancy, such as conditional linking of
image and font libraries, then you will probably need to add
a lot of CMake code to it.

Now that there are more FLTK eyeballs looking at CMake, I'm
sure there must be someone with more extensive and recent
experience who could improve on it.

Cheers
Duncan

This message and any attachments are intended for the use of the addressee or addressees only.
The unauthorised disclosure, use, dissemination or copying (either in whole or in part) of its
content is not permitted.
If you received this message in error, please notify the sender and delete it from your system.
Emails can be altered and their integrity cannot be guaranteed by the sender.

Please consider the environment before printing this email.

Reply all
Reply to author
Forward
0 new messages