Author Topic: FLTK vs. dirent.h resolution  (Read 5087 times)

0 Members and 1 Guest are viewing this topic.

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2129
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
FLTK vs. dirent.h resolution
« 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.  :)
« Last Edit: October 06, 2009, 06:39:31 pm by James »
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!


SMF spam blocked by CleanTalk
SimplePortal 2.3.7 © 2008-2023, SimplePortal