Permission denied

Pages: 123
Jun 13, 2013 at 8:57pm
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 Jun 13, 2013 at 9:00pm
Jun 13, 2013 at 9:05pm
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 Jun 13, 2013 at 9:07pm
Jun 13, 2013 at 9:08pm
1d.exe , cannot open output file bin\Debug\test.exe permission denied
Jun 13, 2013 at 9:09pm
Check your task manager to see if serbest.exe is running.
Jun 13, 2013 at 9:17pm
nope, only my navigator and code block running...
Jun 13, 2013 at 9:28pm
It sounds like a windows security setting regarding .exe's have you turned any features on or off recently?
Jun 13, 2013 at 9:40pm
No, I don't think so. I was on code block and it suddenly happened ...

Jun 13, 2013 at 9:48pm
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 Jun 13, 2013 at 9:51pm
Jun 13, 2013 at 10:20pm
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
Jun 13, 2013 at 10:23pm
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.
Jun 13, 2013 at 10:29pm
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 ?
Jun 14, 2013 at 3:01am
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.
Jun 14, 2013 at 7:25pm
Nope, it still doesn't work. My .exe really disappears.... I don't know where xD
Jun 14, 2013 at 7:32pm
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.
Jun 14, 2013 at 7:54pm
Nope, no cb_console_runner in process.
Jun 14, 2013 at 8:03pm
"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.
Jun 14, 2013 at 8:24pm
It's not here. :/

THis want's to make me cry....(sarcastic)
Jun 14, 2013 at 8:37pm
well I hope you were not actually looking for test.exe it is what ever you named your project.
Jun 14, 2013 at 9:01pm
In fact, that was the name I gave it.
Jun 14, 2013 at 9:06pm
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