ramakrishnan wrote:
> Hello,
> Nice to meet you all.
> This is my first post.

Nice to meet you ;-)

> I am using fltk(1.1.9) under windows with mingw.
> In one application , i use dirent.h in source.

How? Do you include it before or after the FLTK headers, or
what does this mean? If you include it, what is the full
#include statement?

> On compilation , mingw reported about the redefintion of
> 'struct dirent ' error.
> 
> I have traced the bug in the 'filename.h' of 'FL/filename.h'
> in the line:
> -----------------------------------
> line 56:#  if defined(WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
> 
> struct dirent {char d_name[1];};
> ----------------------------------
> is the offending one.
> 
> if i changed it to:
> if defined(WIN32) && !defined(__MINGW32__) && !defined(__CYG.....
> 
> the error disappears.
> 
> I thought that this would have come earlier in this forum and removed in
> fltk 1.1.10 . But it is the same in 1.1.10 source.

I wonder why this didn't come up before.

> Hope this is acceptable and request you to modify if found correct.

I'm not sure about the correctness of your fix. Maybe a newer version
of mingw (w32api) introduced dirent.h, and the existing code was written
before this happened.

Could you please post the result of the following command from your
FLTK root directory:

$ grep -i dir config.h

I'm especially interested in "HAVE_DIRENT_H", but also in all the other
defines in this area.

I assume that you have the grep command available, otherwise you could
also post the lines that look like these (there's no HAVE_SCANDIR_POSIX
in FLTK 1.1.9 though):

/*
  * HAVE_DIRENT_H, HAVE_SYS_NDIR_H, HAVE_SYS_DIR_H, HAVE_NDIR_H,
  * HAVE_SCANDIR, HAVE_SCANDIR_POSIX:
  *
  * Where is <dirent.h> (used only by fl_file_chooser and scandir).
  */

#define HAVE_DIRENT_H 1
/* #undef HAVE_SYS_NDIR_H */
/* #undef HAVE_SYS_DIR_H */
/* #undef HAVE_NDIR_H */
/* #undef HAVE_SCANDIR */
/* #undef HAVE_SCANDIR_POSIX */


BTW: did you run autoconf and ./configure, or did you use any predefined
configure and Makefiles?

Thanks for your help

Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to