News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Working directory appears to change when I run the .exe file.

Started by Sirplentifus, June 20, 2014, 02:21:00 AM

Previous topic - Next topic

Sirplentifus

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

stahta01

Project -> Properties
Tab: "Build Targets"
Select correct "Build Target" in left hand column.
Box: "Execution Working Directory"

Tim S.
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]