Texture in OPENGL Load image problem

The image cannot be found, can anyone please explain me why this is happening ?

I have found this code from the web:

This is what I get:

File Not Found : Users/piravlouaz/Desktop/NeHe.bmp

logout

Saving session…

…copying shared history…

…saving history…truncating history files…

…completed.

I have the image and when I use any image of .bmp type still does not work!

If you use a relative filename, the filename will be interpreted relative to the current directory of the process. For a shortcut, this can be set from the shortcut’s properties dialog (the “Start in” property). Or it can be set by the program itself using the chdir function. If you’re running the program from an IDE, there’s probably an option to set the current directory.

On Windows, programs typically find any associated data files by obtaining the installation directory from a registry key which is set by the installer. For a learning exercise, you may as well just include the directory in the source code, e.g.

    if (!ImageLoad("C:/Users/piravlouaz/Desktop/NeHe.bmp", image1)) {

Hi there,

the path that I get into the error is my path where the file is located.

So the problem is somewhere else.

The error given in your original post:

lists a relative path. This will only work if the current directory happens to be “C:\”. Use an absolute path to avoid this issue.