User forums > Help
Exectution Directory and Debbuger Working Directory
le Pape:
Okay, I think I've found the origin of the problem. Though, I don't know how to correct it (otherwise than by a dirty workaround) or if it is a bug ?
I printed argv[0], that was used someplace in the code and there was a difference between "run" and "debug" :
While runing : "C:\Some\Path\To\My\Project\ProjectName\bin\ProjectNameD.exe"
While debugging : "C:\Some\Path\To\My\Project\ProjectName/bin/ProjectNameD.exe"
That \o/ syndrome...
Do you know where I could configure Code::Blocks to have it debugging with "C:\Some\Path\To\My\Project\ProjectName\bin\ProjectNameD.exe" ?
I saw there was a way to force forward slash / with the tools, but it won't help. :-\
I still can programmatically reformat the input string if needed, but it would be an awfull workaround... ;D
oBFusCATed:
The native API folder delimiter is '/', the sooner you switch to it the better :)
le Pape:
Hi oBFusCATed :)
Thanks for your advice, but...
I'm sorry, I don't get it.
How do I switch ?
For example, when I right-click on my project and open the "Project Settings", in the Filename field, I have : "C:\Some\Path\To\My\Project\ProjectName\ProjectName.cbp"
How do I tell Code::Blocks to change this with forward slashes ?
As I don't use a custom Makefile, the path to the Makefile (Execution Directory) is grayed and given with backslashes.
And more importantly : how do I tell the debugger and/or the runner to pass first argument to the main function with forward slashes instead of backslashes in the path ?
I'm working on Windows... I thought that with Seven there was some improvement in the tolerance of the '/' but that the default delimiter still was '\\' ?
Any clue on how to switch ? (I must have googled with the wrong keywords :-\ )
oBFusCATed:
The low level apis use the '/' or at least have no problem with them.
So my advice was to convert all '\' to '/' at the beginning of your program and be done with it.
You can go the alternative way also -> convert all '/' characters to '\'.
le Pape:
But there is neither '\' nor '/' at the beginning of my program... ???
I can summarize my problem to this :
--- Code: ---//========Main.cpp=========
#include <iostream>
using namespace std;
int main( int argc, char** argv )
{
cout << argv[0] << endl;
return 0;
}
--- End code ---
Project parameters : default
compiler : GNU GCC (MinGW)
Run Output :
--- Code: ---C:\Path\To\That\Test\Project\Problem\bin\
Debug\Problem.exe
Process returned 0 (0x0) execution time : 0.017 s
Press any key to continue.
--- End code ---
Debug Output :
--- Code: ---C:\Path\To\That\Test\Project\Problem/bin/
Debug/Problem.exe
--- End code ---
What should I change in this project to have either only '\' or only '/' ?
I did not write any '\' or '/', it's only the system that is writing it :-\ That's why I don't know how to have it another way :(
I'm sorry, but I really don't get it *puzzled*
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version