f9039b2ae2
git-svn-id: file:///fltk/svn/fltk/trunk@2 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
199 lines
8.1 KiB
Plaintext
199 lines
8.1 KiB
Plaintext
How to compile for Windoze:
|
|
|
|
Fltk has been reported to compile with GNU GCC compilers, with
|
|
MicroSoft Visual C++ version 4 and 5, and with Borland's C++ compiler
|
|
(sorry no info on that here).
|
|
|
|
----------------------------------------------------------------
|
|
Using GNU C compilers (MingW32 and/or Cygnus):
|
|
----------------------------------------------------------------
|
|
|
|
Edited from mail from Carl Thompson:
|
|
|
|
MINGW32 and Cygnus are both ports of the GNU compiler to win32. The
|
|
difference is that Cygnus will emulate a complete Unix development
|
|
environment including nearly all of the standard Unix system calls. This
|
|
allows Unix programs to be ported to win32 possibly without changing a
|
|
single line of source code. However, the applications it generates are big,
|
|
very slow, depend on the Cygnus DLL, and currently somewhat unstable. For
|
|
straight Windows applications / Libraries like FLTK that do not require Unix
|
|
system call emulation, MINGW32 is the superior choice. MINGW32 produces a
|
|
plain Windows binary that is only dependent on the normal Windows DLLs.
|
|
|
|
Some links for getting MINGW32:
|
|
|
|
http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/download.html
|
|
http://www.cygnus.com/misc/gnu-win32/index.html
|
|
ftp://objectcentral.com/mingw32
|
|
|
|
You will of course need GNU make for MINGW32 in addition to the regular
|
|
MINGW32 utilities. You also need the OpenGL header files which
|
|
apparently are not always included with mingw32, get them from the
|
|
above ftp site.
|
|
|
|
More instructions from Rick Sayre (at Pixar):
|
|
|
|
BTW, for what it's worth, here's the list of changes I have to make to get
|
|
fltk and the examples to build under MINGW32 (which I've switched to from
|
|
CYGWIN, since programs compiled under it use standard DLL's rather than the
|
|
extremely bugging cygwin.dll, and it just otherwise seems to work better):
|
|
|
|
Run ./configure
|
|
-
|
|
In makeinclude - change the CFLAGS and CXXFLAGS to add "-O2 -DWIN32"
|
|
change the libraries to "-lgdi32 -luser32" (add "-mwindows" to not get
|
|
a console)
|
|
-
|
|
In config.h - set HAVE_SCANDIR to 0. ./configure seems to do this
|
|
correctly now, but it was occasionally in the past setting it to 1
|
|
-
|
|
in src/Makefile:
|
|
change the "ar" command to use the "ar -M < ar.script" form. This
|
|
is needed only because I compile under Cygwin's B19 bash, which blows up in
|
|
all sorts of bad ways (hard resets[!]) on long command lines. More details
|
|
if you care, but most people might not. Just a warning.
|
|
-
|
|
in test/demo.menu
|
|
Change the paths to DOS form [blech!], don't use "&"
|
|
[A better idea would be to replace system() with a call that knows how
|
|
to fake a fork on Winblows]
|
|
-
|
|
in fluid/Makefile
|
|
Change the make install rules to reference "fluid.exe" for installing and
|
|
strip'ing, rather than "fluid"
|
|
|
|
I suspect that it is very likely not a good idea to try "make install" under
|
|
Windows. Instead, copy "libfltk.a" to "C:\MINGW32\LIB" (replace
|
|
"C:\MINGW32" with the directory in which you installed MINGW32). Then copy
|
|
the entire "FL" directory to "C:\MINGW32\INCLUDE".
|
|
|
|
From Gustavo Hime:
|
|
|
|
First, thank you for the nice piece of software, and congratulations
|
|
on the quality source code. Fltk compiles (and runs) beautifully on
|
|
all the systems I use (Irix 6.4,Solaris 2.5, RedHat Linux 5.0): the
|
|
exception was Windows, where compilation was rather hard.
|
|
|
|
I have just now managed to compile (satisfactorily) fltk on Win95
|
|
using Mingw32: I do not have MSVC (I don't believe in Microsoft
|
|
compilers :)), and we (the project I am engaged in) are going to use
|
|
mingw32 to port unix code to windows anyway, so mingw32 was the way to
|
|
go. Here is a list of what I had to do:
|
|
|
|
Modify ar -mwindows to ar -ruv in your makeinclude.mingw32.
|
|
|
|
Added -DCYGNUS to your *FLAGS variables (I am new to mingw32, I don't
|
|
know what it defines to id itself, but they are so close I don't think
|
|
it matters much).
|
|
|
|
Disable GL overlay in win32/config.h (shouldn't this be the default?).
|
|
|
|
Added dummy makedepend files to directories fluid and src.
|
|
|
|
Created empty lib directory.
|
|
|
|
Fixed scroll.C line 83 (implicit typecast from int to const char * in
|
|
function call, mingw32 has a problem with this)
|
|
|
|
Did not fix list_visuals.C (weird code there, where is the main
|
|
functionfor win32?)
|
|
|
|
And finally, the hardest: downloaded the OpenGL headers for mingw32
|
|
fromftp://objectcentral.com/mingw32. These are not included in the
|
|
mingw32 distribution, and it took me a couple of hours to find them on
|
|
the net. It would be nice to add a note about this in the fltk
|
|
documentation, and I'll send an e-mail asking them to add these
|
|
headers to the mingw32 distribution.
|
|
|
|
Once again, great code. With mingw32, fltk and opengl, I can
|
|
imediatellyport all my old windows code to unix, and I no longer need
|
|
to waste 300+ mb of hard-drive on stupid borland compilers.
|
|
|
|
----------------------------------------------------------------
|
|
Using MSVC++:
|
|
----------------------------------------------------------------
|
|
|
|
If you have MSVC++ 5.0, double click the "fltk.dsw". Make the "fltk"
|
|
project current, and build it. This will create the library in
|
|
../lib/fltkd.lib. To build the demo programs, select the "demo"
|
|
project and build it. To run the demos run the demo project.
|
|
|
|
I only have Pentium and Alpha NT machines running MSVC++ 5.0. Other
|
|
users have reported success compiling fltk on Windowe95, and using
|
|
version 4 of MSVC++, Borland's C++ compiler, and various ports of GCC
|
|
to windows (to use these, look at the "makeinclude" files in
|
|
../makefiles).
|
|
|
|
If you want to make non-console apps you have to do something special,
|
|
and that differs on each compiler/linker package. For MSVC++ the
|
|
secret switch is:
|
|
|
|
/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup
|
|
|
|
For cygwin/mingw32 and perhaps some other compilers based on gcc put
|
|
this in the makeinclude file:
|
|
|
|
LDLIBS =-lgdi32 -luser32 -mwindows
|
|
|
|
There are no makefiles, for MSVC++ or any other compiler, because I
|
|
don't know how to write them (the ones dumped by MSVC++ are useless
|
|
and unreadable).
|
|
|
|
----------------------------------------------------------------
|
|
Other compilers:
|
|
----------------------------------------------------------------
|
|
|
|
I have heard that Borland C++ is usable.
|
|
|
|
You probably need to start with the Unix Makefiles. There is one in
|
|
../src, one in ../fluid, and one in ../test. Edit these as necessary
|
|
and compile. You must add "-DWIN32" to your compiler switches.
|
|
|
|
The biggest problem seems to be differences in the windows.h header
|
|
files (MicroSoft copyrighted theirs?). Some functions and macros have
|
|
different names or are missing.
|
|
|
|
The MSVC++ "makefiles" are totally useless. Ignore that crap.
|
|
|
|
Start with the Unix makefiles, which list all the necessary source
|
|
files. Don't try to compile the files ending in _win32.C, they are
|
|
#included by other files if WIN32 is defined.
|
|
|
|
When compiling the symbol WIN32 must be defined (most compilers do
|
|
this?) and you have to set the include path so the file win32/config.h
|
|
is seen when the code does #include <config.h>. You may need to use
|
|
some sort of switch to force the compiler to compile the files with
|
|
C++ rather than C. On MSVC++ this is the obvious acronym "/TP" :-)
|
|
Not doing these steps will result in lots of cryptic errors.
|
|
|
|
----------------------------------------------------------------
|
|
Known problems and ToDo list:
|
|
----------------------------------------------------------------
|
|
|
|
It does not work if you turn on full optimizations in VC++. I have
|
|
been told this is due to bugs in VC++, but if anybody can find a way
|
|
around them it would be nice... (the "optimize" settings in the
|
|
project files only do partial optimization and work ok).
|
|
|
|
If program is deactivated, Fl::wait() does not return until it is
|
|
activated again, even though things happen, like redraws. This could
|
|
break some programs that rely on executing code after Fl::wait().
|
|
|
|
Fl_Gl_Window::can_do_overlay() returns true until the first time it
|
|
attempts to draw an overlay, and then correctly returns whether or not
|
|
there is overlay hardware.
|
|
|
|
Cut text contains ^J rather than ^M^J to break lines. This is a
|
|
feature, not a bug.
|
|
|
|
Fl_Window::fullscreen() not implemented (should take over the screen
|
|
without a title bar). Currently does maximize instead.
|
|
|
|
Reports of clipping problems on '95. Can't reproduce on NT.
|
|
|
|
Need to import .bmp files into fluid. Wonko has the specs.
|
|
|
|
Can't set icon of windows.
|
|
|
|
Transparent parts of pixmaps do not really work.
|