Author Topic: Codeblocks execution can't find image file  (Read 4468 times)

Offline Zeron

  • Single posting newcomer
  • *
  • Posts: 2
Codeblocks execution can't find image file
« on: December 12, 2015, 05:14:41 pm »
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?


Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2873
Re: Codeblocks execution can't find image file
« Reply #1 on: December 12, 2015, 06:02:21 pm »
I'd guess that the working directory is different between running in CB as opposed to running stand-alone.

Check Project->properties->BuildTargets->ExecutionWorkingDir.
« Last Edit: December 12, 2015, 06:04:40 pm by Pecan »

Offline Zeron

  • Single posting newcomer
  • *
  • Posts: 2
Re: Codeblocks execution can't find image file
« Reply #2 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?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: Codeblocks execution can't find image file
« Reply #3 on: December 12, 2015, 07:34:59 pm »
The directory of the CB project file.

Tim S.

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++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org