| [ Return to Bugs & Features | Roadmap 2.0 | SVN ⇄ GIT ]
STR #2202
Application: | FLTK Library |
Duplicate Of: | STR #2205 |
Status: | 1 - Closed w/Resolution |
Priority: | 3 - Moderate, e.g. unable to compile the software |
Scope: | 2 - Specific to an operating system |
Subsystem: | Core Library |
Summary: | filename_list.cxx doesn't compile |
Version: | 2.0-current |
Created By: | parshin |
Assigned To: | AlbrechtS |
Fix Version: | 2.0-current |
Update Notification: | |
Trouble Report Files:
Trouble Report Comments:
|
#1 | parshin 15:32 Jun 01, 2009 |
| filename_cxx doesn't compile on Linux due incorrect scandir usage. Current code (doesn't compile): int n = scandir(d, list, 0, (int(*)(const void*,const void*))sort); Correct code (compiles): int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort);
Compile: gcc-4.3.3 on 64bit Gentoo Linux. The patch is attached. Both 1.9 and 2.x versions are affected. I didn't check it for earlier FLTK versions. The problem seems to be connected to latest GCC changes. | |
|
#2 | engelsman 13:16 Jun 10, 2009 |
| For info (because I'm no 32-bit/64-bit system guru)
From what I can see, both fltk-1.1.9 and fltk-1.3.x have already been updated (or rather, the filename_list.cxx code doesn't match what appears in the patch above).
I just checked out the FLTK-2.0 sources, and on my 32-bit Linux system, with gcc-4.2.4, the vanilla sources built OK, but if I apply your changes, I get the following error:
duncan@wired ~/src/fltk-2.0.x/fltk $ make === making src === Compiling filename_list.cxx... filename_list.cxx: In function 'int fltk::filename_list(const char*, dirent64***, int (*)(const dirent64* const*, const dirent64* const*))': filename_list.cxx:68: error: invalid conversion from 'int (*)(const dirent64**, const dirent64**)' to 'int (*)(const void*, const void*)' filename_list.cxx:68: error: initializing argument 4 of 'int scandir64(const char*, dirent64***, int (*)(const dirent64*), int (*)(const void*, const void*))' make[1]: *** [filename_list.o] Error 1 make: *** [all] Error 2
I get a similar (same?) message if I keep the vanilla source, but change HAVE_SCANDIR to 0 in config.h
duncan@wired ~/src/fltk-2.0.x/fltk $ g++ -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../configure --host=i686-pc-linux-gnu --enable-languages=c++ --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --enable-__cxa_atexit --enable-threads --disable-nls --enable-target-optspace --with-gnu-ld --with-system-zlib --enable-shared Thread model: posix gcc version 4.2.4 | |
|
#3 | ianmacarthur 03:05 Jul 14, 2009 |
| This seems to be the same bug as STR #2205.
The problem seems to be related to changes in GLIBC in recent versions of Fedora.
The patch proposed here is no good, it will break every other build. | |
|
#4 | parshin 05:31 Jul 14, 2009 |
| Well, I observe the same effect on any machine with the new GLIBC. My favorite distributions are RedHat and Gentoo - both affected. The way out may be making patch conditional to GLIBC. There should be something in the headers that allows to distinguish GLIBC versions. | |
|
#5 | AlbrechtS 15:53 Jul 23, 2009 |
| As noted before, this appears to be the same problem as in STR 2205. The patch file http://www.fltk.org/strfiles/2205/scandir_posix.patch apparently solves the problem.
This STR will be closed now, please see STR #2205 for a final update. | |
[ Return to Bugs & Features ]
|
| |