LaserBoy

Software => Joint Development => Topic started by: James on September 13, 2009, 05:00:30 pm

Title: FLTK vs. dirent.h resolution
Post by: James on September 13, 2009, 05:00:30 pm
If you use Dev-C++ and FLTK, you might want to know that including both the ANSC C lib header dirent.h AND the FLTK header Fl_File_Chooser.H you will generate an error, that the struct dirent is being redifined.

Look for these lines in filename.H (an FLTK header file) at about line 55.
Code: [Select]
#  if defined(WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)

struct dirent {char d_name[1];};


Add this to the end: [    && !defined(__DEV_CPP__)    ]
Code: [Select]
#  if defined(WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__) && !defined(__DEV_CPP__)

struct dirent {char d_name[1];};

Now all you have to do is make sure you add the following line early in your pre-processor code, before Fl_File_Chooser.H. This has already been added to LaserBoy_macros.hpp, in the most current version of the code.
Code: [Select]
#define    __DEV_CPP__ // to resolve FLTK dirent.h conflict

And it will work without breaking the code for any other compiler!

James.  :)
SimplePortal 2.3.7 © 2008-2024, SimplePortal