User forums > Help

Can't load an image file by using relative filename.

(1/2) > >>

indigo0086:
Basically I have a GLFW project that loads an image file that is in the base directory (the one where the project is located) but in order for me to do It I can't just can't load it by the filename, I have to put the entire path to the filename.
Example.


--- Code: ---rustWall.Load("RustyWall.tga");
--- End code ---

does not work but


--- Code: ---rustWall.Load("Z:\\Cpp\\OpenGL Examples\\GLFW Project\\RustyWall.tga");
--- End code ---

does.

I have other example programs that use the base directory properly but this one does not.  It's been like this for several revisions of codeblocks nightly.


TDragon:
Check your executable target's "Execution working dir" in your build target properties -- if you want it to be the same directory as the project file, just use ".". (Note: This only applies when running your program from within C::B.)

indigo0086:
Ok I got it, now how do I set it to be that way default?

TDragon:

--- Quote from: indigo0086 on May 12, 2007, 06:30:52 pm ---Ok I got it, now how do I set it to be that way default?

--- End quote ---
I don't understand your question...

indigo0086:
The GLFW projects don't have "." as the default "execution working dir".  How do I set it so that it is in future projects?

Navigation

[0] Message Index

[#] Next page

Go to full version