On 26.02.2015 23:16 Hannu Vuolasaho wrote:
>
> On Thursday, February 26, 2015 at 4:49:35 PM UTC+2, Albrecht Schlosser
> wrote:
>
> On 26.02.2015 03:27 Hannu Vuolasaho wrote:
> > Hello!
> >
> > I just set up windows 8.1 virtual environment for me and build FLTK
> > succesfully (99.9%) with Cygwin. Sudoku failed with icon.
>
> Your configure command didn't find the windres tool. See below.
>
> It seems that --host=i686....mingw enables that. I got that fixed later.
Okay, fine.
> My motivation of this post is that I have rather bigger project than
> normally
> and it needs to be linux and windows compatible. FLTK wil be my UI library.
> I wanted to document one way how to get FLTK working.
Thanks for doing that. It is always good for other users to see.
> Note that we do not recommend using Cygwin for building FLTK under
> Windows, unless you really know what you're doing (and why) and/or you
> need Cygwin's POSIX functions - which makes your FLTK programs
> depend on
> Cygwin1.dll and requires a Cygwin license if you want to write
> commercial programs or redistribute you programs. Also Cygwin is not
> easy to set up.
>
>
> So far I'm developing on Linux and some compilation stuff needs Linux or
> cygwin.
> I'll try to get rid of POSIX requirement and make that part more
> portable. And cygwin
> is quite easy. base auto* make and mingw toolchain.
It *can* be easy, particularly if you have Linux/Unix experience.
However there are very often some problems that make working with Cygwin
difficult. Hence we recommend MinGW because it is easier to setup for
the occasional user (someone who needs a working environment to build
Windows programs but doesn't want to use MS IDE's).
> Anyway to keep constant testing, both platforms
> need to be able to run the binaries.
>
> I believe I used mingw toolchain in cygwin environment. All bineries are
> runnable
> in another system which doesn't have cygwin.
Yes, the way you configured it you are using the MinGW cross compilers.
However Cygwin's POSIX layer (cygwin1.dll) is not involved in this
configuration. If that is what you want then you can also use MinGW. But
if you are familiar with Cygwin it's your choice, of course.
> However I'm not 100% sure about the Cygwin library if it got compiled in
> with -static.
> At least I ran with mingw cross compiler.
You can't compile and link the Cygwin library static. The only way to
use it is to link in cygwin1.dll (and maybe more dll's) with all the
implications regarding licensing.
> BTW how do I enable real compilation commands instead of compiling
> foo... output?
You can edit makeinclude (in the FLTK root directory) and remove or
comment the '.SILENT' line.
If you are interested only in one command there's a nice trick I'm using
sometimes: if you have compiled FLTK already, delete one particular
object (.o) file and then run 'make -n'. This does not execute the
command, but it shows you the entire command(s).
> The FLTK team recommend using MinGW instead.
>
>
> I would recomend also. And Eclipse, QT-creator and so on.
>
> While I'm OK with command prompt, 99% of Windows developers aren't and
> they want solution files.
Currently we have only Xcode (Mac OS X) and Windows IDE support files.
We're making progress with CMake, and the idea is that users can
generate their IDE files with CMake (of course you need CMake then).
> I don't really understand what though you wrote here. Did you use
> svn to
> download, or did you download FLTK with git (where from)? Maybe git
> svn?
> URL?
>
> I have just checkouted SVN repo to my tree as I will use it as static
> library.
> Transferring data between machines is done through git. I'm not even using
> git-svn as it can't handle that well svn submodules. So really wrong way.
Okay, I see.
> And I would use stable version, but there is some good bugfix after 1.3.3
> which I needed :)
I hope we can release 1.3.4 in April or so, but there is no schedule yet.
> And the reason to write it here was quite simple.
> I wanted to document over how I did it. And with few repeats I was able to
> get the process how I descripbed.
>
> I tried few times with mingw installation and always ended up path
> problems
> and depedency hell all the fun stuff you don't want to have on Windows.
You found your way under Cygwin, and MinGW is absolutely the same,
except you don't need the cross compiling setup.
make distclean && LDFLAGS='-static-libstdc++ -static-libgcc' ./configure
&& make
> But I have some idea how I would get MinGW working after I don't depend
> POSIX any more.
That should be easy. Meanwhile MinGW has a good install tool.
> We ended up same configure parameters and environment variables.
> I have static in LDFLAGS also.
Okay.
> 'make' runs w/o warnings and some (but not all) of the resulting
> executable files are native Windows programs (can be launched from
> explorer and distributed w/o Cygwin dll).
>
>
> I can run every program on different computer which hasn't even seen
> cygwin.
That's good if that is what you intend. It's much more complicated if
you need the Cygwin dll and want to distribute your program to systems
that are not directly under your control.
> Note: Unfortunately LDFLAGS is not propagated correctly in all cases
> when linking the demo programs in the test/ directory. Some of them are
> linked with '-static-libstdc++ -static-libgcc' (for instance glpuzzle)
>
>
> GLpuzzle included.
Yes, here as well. The issue described above was caused by a typo on my
side. See my follow-up.
> I thank everybody for feedback.
You're welcome.
Thanks for your report.