GLUT OPENIL and kernel32.dll

I am using glut to load a model with textures. I am using the openil lib for the textures. I can get everything to work fine under the windows api, but when I try to use glut everything compiles and links fine, but then when I try to run the application I just created I get an error message when it starts up that says that my application has caused an error with the kernel32.dll.
does anyone know how to fix this problem?

I think it is just a problem of link: a contradiction between the *.lib used for linking and the *.dll used for runing.

Verify that the libraries (*.lib) which you link have the same carcateristics (date,etc.) that the dll which are called when you try to run the application.
Verify the path particularly the priority. It is possible that dll taken for runing are not those you believe.