I have my Project's "Build Options" set so that my
"Executable output directory" is "bin". My problem is that
as soon as I hit a breakpoint during debug, my "working
directory" changes from bin and instead the working
directory becomes the project directory.
e.g.,
c:\temp\myapp (project directory)
c:\temp\myapp\bin (executable output directory)
When I run the executable manually, or hit debug without
any breakpoints, the temp.fil is written to my bin
directory, as expected. But if I set a breakpoint -- on the
first line inside main(), for example, my temp.fil is then
written to the myapp project directory.
My workaround to this is to parse argv[0] (.exe name
with full path) and then prefix any i/o file names with the
parsed path.
To reproduce the error -- here's my main.cpp
Project set so .exe gets output to bin directory. Run
once without setting breakpoint (temp.fil will be in the bin
directory) and then run once with breakboint on first line
in main() (temp.fil will now end up in the project
directory.)
// File: main.cpp
using namespace std;
int main(int argc, char *argv[])
{
ofstream of("temp.fil");
return 0;
}
Logged In: YES
user_id=682737
Confirmed with the latest version from CVS.