Code::Blocks Forums

User forums => Help => Topic started by: Sirplentifus on June 20, 2014, 02:21:00 am

Title: Working directory appears to change when I run the .exe file.
Post by: Sirplentifus on June 20, 2014, 02:21:00 am
I made a program that opens a file, which is in the same folder as the project. When I run the program from within Code::Blocks, everything is fine (the working directory is set to the project directory)

However, when I run the actual .exe file, it fails to load the file. If I move the file to the directory of the .exe, it works now, but the same error now occurs when I run the program from within Code::Blocks.

It's as if the working directory is different when I run the program from the .exe... How do I set that working directory?

Thanks in advance  :D
Title: Re: Working directory appears to change when I run the .exe file.
Post by: stahta01 on June 20, 2014, 02:48:53 am
Project -> Properties
Tab: "Build Targets"
Select correct "Build Target" in left hand column.
Box: "Execution Working Directory"

Tim S.