DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2819
Version: 1.3-current


The following simple test program can't be compiled with a current MinGW
installation:

#include <dirent.h>
#include <FL/Fl_File_Chooser.H>

int main(int argc, char **argv) {
  return 0;
}

Error message:
$ fltk-config --compile dirent.cxx
g++ -I/fltk-1.3 -I/fltk-1.3/png -I/fltk-1.3/zlib -I/fltk-1.3/jpeg
-mwindows -DWIN32 -DUSE_OPENGL32 -DFL_ABI_OVERRIDE=10302
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -o 'dirent' 'dirent.cxx'
-mwindows /fltk-1.3/lib/libfltk.a -lole32 -luuid -lcomctl32
In file included from J:/fltk-1.3/FL/Fl_File_Browser.H:31:0,
                 from dirent.cxx:2:
J:/fltk-1.3/FL/filename.H:75:8: error: redefinition of 'struct dirent'
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/../../../../include/dirent.h:22:8:
error: previous definition of 'struct dirent'

The problem is that FLTK "believes" that MinGW doesn't have dirent.h and
adds an own definition of struct dirent.

The suggested patch would be to #include <dirent.h> instead if the
compilation is for MinGW (see attached file dirent.patch).

Could someone with an older MinGW version (Ian, maybe?) please verify:

(1) HAVE_DIRENT_H is definede as 1 in config.h
(2) the test program shown above compiles with the applied patch
    (and shows errors w/o the patch).

If this could be confirmed, I'd commit the patch...


Link: http://www.fltk.org/str.php?L2819
Version: 1.3-current
Index: FL/filename.H
===================================================================
--- FL/filename.H       (revision 9329)
+++ FL/filename.H       (working copy)
@@ -70,7 +70,7 @@
 #  endif /* __cplusplus */
 
 
-#  if defined(WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
+#  if defined(WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__) && 
!defined(__WATCOMC__)
 
 struct dirent {char d_name[1];};
 
_______________________________________________
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to