Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

slooksterPSV

macrumors 68040
Original poster
Apr 17, 2004
3,543
305
Nowheresville
This is a HOW-TO Faq to help those who are having trouble with installing and running FLTK. Don't be discouraged, FLTK is very very compatible with Linux, Unix, Mac OS X, Windows, Solaris, etc.

I made this cause I had all the trouble configuring, and using fltk-config. This helped me to alleviate a lot of the problems. NOTE: You can still use xcode to program your code, just remember that the extension has to be a cxx or cpp file.

REQUIREMENTS:
Mac OS X - May work on version previous to Panther, but I'm using Panther
XCode 1.0 or later - I'm using XCode 1.0 that came with Panther Server
FLTK - v1.1.6 or later - We'll download this in the HOW-TO so don't fret if you don't have it yet you will.
Basic Knowledge of Terminal

-------------------------------------
Step 1:
Download FLTK v1.1.6 or later (that includes .x snapshot) from http://www.fltk.org/software.php the tar.bz2 is only 1855KB so I got that one (it was the one that was that size so if I got the bz2 wrong sorry).

Step 2:
Install FLTK v1.1.6 or later. Be sure to extract the tar.bz2 file (or whatever you got) using StuffIt Expander. Usually it downloads and extracts on the Desktop so we'll go with reference to that.
Open Terminal and type in - this is if it extracted to the desktop:
Code:
cd ~
cd Desktop
cd fltk[tab key to fill in the rest]  (NOTE THIS ONLY WORKS ON PANTHER AND HIGHER TO MY KNOWLEDGE)
./configure
make
sudo make install
Now, if you don't have configure or it doesn't work on the first attempt, type in make, this will run config.status and make a configure file and run it.
This process takes about 30 min. starting with make. So you've got a while.

Step 3:
Now locate to the directory where you will save and execute and create your projects. Now in terminal type this, you will create this in the directory where you will be saving your projects:
Code:
pico fltk-config.sh
/usr/local/bin/fltk-config --compile $1
echo "The file " + $1 + " may have been compiled, check for errors above this statement."
echo "The file will be saved as " + $1 + " minus the cpp or cxx extension."
Press the keys: Control+O to save it and Control+X to quit
chmod +x fltk-config.sh

Step 4:
Test it out! Type in this:
Code:
pico test.cpp
#include <FL/Fl.H>
#include <FL/Fl_Window.H>

int main()
{
  Fl_Window *win;
  win = new Fl_Window(400, 300, "Hello FLTK");
  win->end();
  win->show();
  return Fl::run();
}
Press Control+O, Enter to save then Control+X to exit
./fltk-config.sh test.cpp

EXTRA INFORMATION
---------------------
I plan to create a FLTK compiler that uses fltk-config. I'm going to start work on this tonight and hopefully have it finished in two weeks. I hope, but with school, things aren't getting done too quickly.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.