Greg Ercolano wrote:
> I've never used this function before, but I whipped this short
> example together, and it seemed to work on the first shot:
Oh, and I should add that code was with 1.3.x.
But I find if I comment out the fl_filename_free_list() line
(which I guess isn't in 1.1.10), it seemed to compile and run OK
under 1.1.10 on Snow Leopard as well, eg:
* * *
03/31/11 01:56:55 /usr/local/src/fltk-1.1.10/test
[root@snow] 31 # cat filenamelist.cxx
#include <stdio.h>
#include <FL/filename.H>
int main() {
const char *dirname = "/usr";
dirent **dlist;
int total = fl_filename_list(dirname, &dlist, fl_alphasort);
for ( int t=0; t<total; t++ ) {
printf("%d) '%s'\n", t, dlist[t]->d_name);
}
//fl_filename_free_list(&dlist, total);
return(0);
}
03/31/11 01:57:00 /usr/local/src/fltk-1.1.10/test
[root@snow] 32 # ../fltk-config --compile filenamelist.cxx
g++ -I.. -I../png -I../jpeg -arch i386 -o filenamelist filenamelist.cxx -arch
i386 ../lib/libfltk.a -framework Carbon -framework ApplicationServices
/Developer/Tools/Rez -t APPL -o filenamelist ../FL/mac.r
03/31/11 01:57:06 /usr/local/src/fltk-1.1.10/test
[root@snow] 33 # ./filenamelist
0) './'
1) '../'
2) 'X11/'
3) 'X11R6/'
4) 'bin/'
5) 'discreet/'
6) 'etc/'
7) 'include/'
8) 'lib/'
9) 'libexec/'
10) 'llvm-gcc-4.2/'
11) 'local/'
12) 'sbin/'
13) 'share/'
14) 'standalone/'
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk