Permission denied

Pages: 123
Hi, for a weird reason, I get 1 error which says : Permission Denied.
I don't think the code is the problem because I've tried it with other legit codes and it still gives me this error.

1
2
3
4
5
6
7
8
9
10
11
12
13
 #include <iostream>

using namespace std;

int main()
{
string nom("x");
cout << "Vous avez quel age ?";
cin >> nom;
cout << "Vous avez-vous donc" << nom << "ans?" ;
return 0 ;
}

Any idea how to stop this error? Thanks
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 #include <iostream>

using namespace std;

int main()
{
string nom("x");
cout << "Vous avez quel age ?\n";
cin >> nom;
cout << "Vous avez-vous donc " << nom << " ans?" ;
cin.get();
cin.get();
return 0 ;
}


I added cin.get(); for a pause at the end so you could see the results
I didn't get any errors compiling. can you post the actual error.

Edit: I don't speak french.
Last edited on
1d.exe , cannot open output file bin\Debug\test.exe permission denied
Check your task manager to see if serbest.exe is running.
nope, only my navigator and code block running...
It sounds like a windows security setting regarding .exe's have you turned any features on or off recently?
No, I don't think so. I was on code block and it suddenly happened ...

The weird thing is... I deleted everything and created a new project. The first try when I compiled my code, everything worked. (The Hello world message)
after, I added my own code, and it compiled again, the console showed up but the it didn't execute my code. Now, the console doesn't even show up, it says my permission is denied. :( What the... is happening ? In fact, my .exe even goes away, maybe that's the reason it's not working.
Last edited on
Have you tried rerunning it with the couple lines of code I added? Not having a pause or cin.get(); at the end will cause it to close automatically
1d.exe , cannot open output file bin\Debug\test.exe permission denied

This means the application is still running and the linker is unable to link to create a new one. You need to ensure it's not running.
The code of Blanchy worked! With the cin.get(); , it works perfectly.

When I do not put it, the whole thing messes up and giving me the same problems... Even when I reput the cin.get(); , forget it, it stops working. Could anybody explain why ?
Idk man it sounds like you .exe files are having a hard time getting shutdown properly, if you get it up and running again try to manual end the process in your task manager and see if that helps.
Nope, it still doesn't work. My .exe really disappears.... I don't know where xD
Go to the task manager and then go to processes and it is probably at the very bottom still running it more than likely wont be under applications where you looked I am guessing.
Nope, no cb_console_runner in process.
"cb_console_runner" isn't your program. It is a parent process which runs the program for you. The actual program will have a different name, "test.exe" I guess.
It's not here. :/

THis want's to make me cry....(sarcastic)
well I hope you were not actually looking for test.exe it is what ever you named your project.
In fact, that was the name I gave it.
Ah geeez, I did a copy of my .exe file on my desktop and recompiled my programm and it started doing the error. But the one on my desktop is still here, tried to put it back in my folder and it says I can't do that. (Im the administrator on my computer.)
Pages: 123