DevIL icon indicating copy to clipboard operation
DevIL copied to clipboard

devil configured without --enable-ILUT still refers to <IL/ilut.h> in devil_cpp_wrapper.hpp

Open ilovezfs opened this issue 8 years ago • 0 comments

When built without "--enable-ILUT", if you try to compile

#include <IL/devil_cpp_wrapper.hpp>
int main() {
  ilImage image;
  return 0;
}

the following error occurs:

bash-3.2$ /usr/bin/clang++ test.cpp -L/usr/local/Cellar/devil/HEAD/lib -lIL -lILU -o test
In file included from test.cpp:1:
/usr/local/include/IL/devil_cpp_wrapper.hpp:4:10: fatal error: 'IL/ilut.h' file not found
#include <IL/ilut.h>  // Probably only have to #include this one
         ^
1 error generated.

I am able to work around this by applying the following patch for non-ilut builds:

      inreplace "include/IL/devil_cpp_wrapper.hpp",
        "<IL/ilut.h>", "\"ilu.h\""

If I just delete #include <IL/ilut.h>, instead of replacing it with #include "ilut.h", then I get this error instead:

In file included from test.cpp:1:
/usr/local/include/IL/devil_cpp_wrapper.hpp:10:13: error: unknown type name 'ILconst_string'
                                ilImage(ILconst_string);
                                        ^
/usr/local/include/IL/devil_cpp_wrapper.hpp:14:2: error: unknown type name 'ILboolean'
        ILboolean       Load(ILconst_string);
        ^
/usr/local/include/IL/devil_cpp_wrapper.hpp:14:17: error: unknown type name 'ILconst_string'
        ILboolean       Load(ILconst_string);
                             ^
...

fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

ilovezfs avatar May 04 '16 17:05 ilovezfs