Code::Blocks Forums

User forums => Help => Topic started by: Kzone272 on August 01, 2011, 01:30:04 am

Title: Can't load .bmp file when running in C::B (works fine outside of C::B)
Post by: Kzone272 on August 01, 2011, 01:30:04 am
I've been using OpenGL for only a couple of days, and I'm just starting to experiment with textures.  The problem I'm having (as mentioned above) is that when I try running the program inside of C::B (Build>>Run), it fails to load the image (even though the output .exe is in the same directory as the .bmp image).  However when I run the .exe in Windows Explorer the image loads in without any problems.  So it seems like C::B is running the .exe from another directory other than where the output .exe is.  I've tried adding the .bmp file to the project, but that didn't change anything.  Is there anyway I can either get C::B to run the .exe in the output directory (if that's the problem), or add the .bmp to the project somehow to make it load properly?  Here's a copy of my build log if it helps:

Code
Checking for existence: C:\Users\Kevin\Documents\C++\OpenGL\Textures\Textures.exe
Executing: "C:\Program Files\CodeBlocks/cb_console_runner.exe" "C:\Users\Kevin\Documents\C++\OpenGL\Textures\Textures.exe"  (in C:\Program Files\CodeBlocks\MinGW\bin)
Title: Re: Can't load .bmp file when running in C::B (works fine outside of C::B)
Post by: MortenMacFly on August 01, 2011, 06:50:33 am
Executing: "C:\Program Files\CodeBlocks/cb_console_runner.exe" "C:\Users\Kevin\Documents\C++\OpenGL\Textures\Textures.exe"  (in C:\Program Files\CodeBlocks\MinGW\bin)
As usual, you should carefully inspect the log of Code::Blocks. You are running your app in the MinGW/bin directory where surely the textures are not.
Please setup the application path to run from in the project options for the appropriate target.
Title: Re: Can't load .bmp file when running in C::B (works fine outside of C::B)
Post by: Kzone272 on August 01, 2011, 09:59:15 pm
Yeah I thought that was it, but I can't find that setting in the menu.  Any idea where I can find it?  I'm still looking.

Nevermind I just found it.  Thanks for the help!
Title: Re: Can't load .bmp file when running in C::B (works fine outside of C::B)
Post by: Jenna on August 01, 2011, 10:03:00 pm
"Project -> Properties -> Build targets"