I am writing a C++ OpenGL project using DevIL and I am getting compile-time errors while trying to work out how to load an image to use as a texture.
So far I have this
//Declarations
const char* filename = "back.bmp";
ILboolean ilLoadImage(const char *filename);
ILuint image;
ilGenImages(1, &image);
ilBindImage(image);
//Load the image
if (!ilLoadImage(filename))
{
throw runtime_error("Unable to load image" +filename);
}
which presents me with the error: error C2110: '+' : cannot add two pointers
if I change the declaration of filename
to string filename = "back.bmp";
and the if statement to
if (!ilLoadImage(const_cast<char*>(filename.c_str())))
I get this linker error error LNK1104: cannot open file 'DevIL.libkernel32.lib'
I am certain that I have placed all the DevIL files where they need to be and added the dependencies in Project->Properties->Linker->Input->Additional Dependencies.