2

This is very strange or very simple. I am using Devil library and in the very simple program I have to initialize it by:

ilInit();
iluInit();

And here is the problem. IlInit() works fine, but iluInit() is not! It can not find the reference.

Of course I include headers:

#include <IL/il.h>
#include <IL/ilu.h>

And compile my file by:

g++ -std=gnu++11 -O3 myIL.cpp -lglfw3 -lGL -lGLEW -lIL -lGLU -lX11 -lXxf86vm -lpthread -lXrandr -lXi -o myIL

(generally I want to use Devil lib for OpenGL project but I don't think it is important right now).

I have also all headers in /usr/include/IL and *.a, *.so etc. files in /usr/lib/x86_64-linux-gnu.

Btw it also be great if someone could explain me what the difference between IlInit(), iluInit() and ilutInit(). I cannot find the simple explanation.

paspy
  • 23
  • 1
  • 7
  • Three different libraries, DevIL, ILU and ILUT. Who the heck comes up with names like that :( Doesn't look like you are linking any of them. – Hans Passant Nov 13 '15 at 11:42
  • Isn't this `-lIL` for linking library(ies)? – paspy Nov 13 '15 at 12:49
  • Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Walter Nov 13 '15 at 13:41

1 Answers1

3

I don't know anything about devils, but I suspect you forgot to link against the relevant library -- wouldn't that be libILU.so, i.e. require the compiler/loader option -lILU?

Walter
  • 44,150
  • 20
  • 113
  • 196
  • 1
    Yes, I thought so that it will be very easy.... The same is when you want to use `ilutInit()` you have to include `#include ` AND add `-lILUT`. Thanks a lot!! – paspy Nov 15 '15 at 11:23