Build FLTK libs in CodeBlocks

1. Download FLTK source from:

    http://www.fltk.org/software.php?VERSION=1.3.x-r8295&FILE=fltk/1.1.10/fltk-1.1.10-source.tar.gz

2. Extract: tar xzvf fltk-1.1.10-source.tar.gz

3. cd ~/cpp/fltk-1.1.10

4. mkdir codeblocks

5. cd codeblocks

6. cmake .. -G "CodeBlocks - Unix Makefiles"

7. mkdir apps

8. Patch te file: 

patch file:

========================================================================================

--- filename_list.cxx Wed Nov 18 18:20:22 2009 +0800 

+++ filename_list.cxx Fri Nov 27 08:45:01 2009 +0100 

@@ -61,6 +61,9 @@

 #elif defined(__hpux) || defined(__CYGWIN__) || defined(sun) 

   // HP-UX, Cygwin define the comparison function like this: 

   int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort); 

+ #elif defined(HAVE_SCANDIR_POSIX) 

+  // POSIX (2008) defines the comparison function like this: 

+  int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort); 

 #elif defined(__osf__) 

   // OSF, DU 4.0x 

   int n = scandir(d, list, 0, (int(*)(dirent **, dirent **))sort); 

@@ -71,7 +74,7 @@

   // The vast majority of UNIX systems want the sort function to have this 

   // prototype, most likely so that it can be passed to qsort without any 

   // changes: 

int n = scandir(d, list, 0, (int(*)(const void*,const void*))sort); 

int n = scandir(d, list, 0, (int(*)(const dirent**,const dirent**))sort); 

 #else 

   // This version is when we define our own scandir (WIN32 and perhaps 

   // some Unix systems) and apparently on IRIX: 

========================================================================================

filename_list.cxx:

int fl_filename_list(const char *d, dirent ***list,

                     Fl_File_Sort_F *sort) {

#ifndef HAVE_SCANDIR

  int n = scandir(d, list, 0, sort);

#elif defined(HAVE_SCANDIR_POSIX)

  // POSIX (2008) defines the comparison function like this:

  int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort);

#elif defined(__osf__)

  // OSF, DU 4.0x

  int n = scandir(d, list, 0, (int(*)(dirent **, dirent **))sort);

#elif defined(_AIX)

  // AIX is almost standard...

  int n = scandir(d, list, 0, (int(*)(void*, void*))sort);

#elif !defined(__sgi)

  // The vast majority of UNIX systems want the sort function to have this

  // prototype, most likely so that it can be passed to qsort without any

  // changes:

  //int n = scandir(d, list, 0, (int(*)(const void*,const void*))sort);

  int n = scandir(d, list, 0, (int(*)(const dirent**,const dirent**))sort);

#else

  // This version is when we define our own scandir (WIN32 and perhaps

  // some Unix systems) and apparently on IRIX:

  int n = scandir(d, list, 0, sort);

#endif

9. Start CodeBlocks open FLTK.cbp and build the libraies and examples.