Article #369: How Do I Compile FLTK?

  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Articles | Show Comments | Submit Comment ]

Article #369: How Do I Compile FLTK?

Created at 10:59 Jan 29, 2005 by mike

In most cases you can just type "make". This will run configure with  the default of no options and then compile everything.

FLTK uses GNU autoconf to configure itself for your UNIX platform. The main things that the configure script will look for are the X11 and OpenGL (or Mesa) header and library files.  If these cannot be found in the standard include/library locations you'll need to define the CFLAGS, CXXFLAGS, and LDFLAGS environment variables. For the Bourne and Korn shells you'd use:

CFLAGS=-Iincludedir; export CFLAGS
CXXFLAGS=-Iincludedir; export CXXFLAGS
LDFLAGS=-Llibdir; export LDFLAGS

For C shell and tcsh, use:

setenv CFLAGS "-Iincludedir"
setenv CXXFLAGS "-Iincludedir"
setenv LDFLAGS "-Llibdir"

By default configure will look for a C++ compiler named CC, c++, g++, or gcc in that order. To use another compiler you need to set the CXX environment variable:

CXX=xlC; export CXX
setenv CXX "xlC"

The CC environment variable can also be used to override the default C compiler (cc or gcc), which is used for a few FLTK source files.

You can run configure yourself to get the exact setup you need. Type "./configure <options>", where options are:

<DL>
        <DT>--enable-debug</DT>
        <DD>Enable debugging code & symbols</DD>

        <DT>--enable-shared</DT>
        <DD>Enable generation of shared libraries</DD>

        <DT>--bindir=/path</DT>
        <DD>Set the location for executables [default = /usr/local/bin]</DD>

        <DT>--includedir=/path</DT>
        <DD>Set the location for include files. [default = /usr/local/include]</DD>

        <DT>--libdir=/path</DT>
        <DD>Set the location for libraries [default = /usr/local/lib]</DD>

        <DT>--mandir=/path</DT>
        <DD>Set the location for man pages [default = /usr/local/man]</DD>

        <DT>--prefix=/dir</DT>
        <DD>Set the directory prefix for files [default = /usr/local]</DD> </DL>

When the configure script is done you can just run the "make" command. This will build the library, FLUID tool, and all of the test programs.

To install the library, become root and type "make install". This will copy the "fluid" executable to "bindir", the header files to "includedir", the library files to "libdir", the man pages to "mandir", and the documentation files to the documentation directory - usually /usr/local/share/doc/fltk.

Download | Home Page | Listing ]


Comments

Submit Comment ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2015 by Bill Spitzak and others. This project is hosted by Seriss Corporation. Please report site problems to 'erco@seriss.com'.