News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Codeblocks execution can't find image file

Started by Zeron, December 12, 2015, 05:14:41 PM

Previous topic - Next topic

Zeron

I am new to codeblocks and to c programming. I'm trying to write a simple program that loads an image. The code copiles without errors and I am able to execute it manually from the konsole without problems, but when I try to run the code from within IDE it can't find the image file. Why is that? What am I doing wrong?


Pecan

#1
I'd guess that the working directory is different between running in CB as opposed to running stand-alone.

Check Project->properties->BuildTargets->ExecutionWorkingDir.

Zeron

Ah, I see it. The field contains only a dot: "." -- both in "Release" and in "Debug" targets. As I understand it it simply means current directory. But is it the dir of the project or of the executable? Should I change it?

stahta01

The directory of the CB project file.

Tim S.

Quote from: Zeron on December 12, 2015, 06:27:15 PM
Ah, I see it. The field contains only a dot: "." -- both in "Release" and in "Debug" targets. As I understand it it simply means current directory. But is it the dir of the project or of the executable? Should I change it?
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]