Hi, While trying to compile octave-3.6.1 with MSVC, I found a problem related to the ordering of include paths in CPPFLAGS. For instance, in liboctave/Makefile.am, the flags are defined as:
AM_CPPFLAGS = \ @CPPFLAGS@ -I../libgnu -I$(top_srcdir)/libgnu \ -I$(top_srcdir)/libcruft/misc So if you call configure script like: ./configure .... CPPFLAGS="-I/my/special/path".... the added include path will appear *before* gnulib headers. So if one gnulib header is supposed to override one of the header in /my/special/path, it'll fail as the original one will be picked up first. This happened to me, as I have a version of dirent.h in /my/special/path, which is picked first instead of gnulib dirent.h. This eventually leads to a compilation failure in dir-ops.cc: dir-ops.cc(56) : error C2039: 'opendir' : is not a member of 'gnulib' dir-ops.cc(80) : error C2039: 'readdir' : is not a member of 'gnulib' dir-ops.cc(98) : error C2039: 'closedir' : is not a member of 'gnulib' I'm not sure where the error is: 1) CPPFLAGS should never contain any include path with headers that gnulib is supposed to override 2) in liboctave/Makefile.am, @CPPFLAGS@ should be moved to the end, or after "-I../libgnu" 3) ...? Any suggestion? Michael..
