0
votes

I have searched for this question all over the Internet, including Stack Overflow, and have not found an answer that solves my problem.

I am running the Code::Blocks IDE on Windows 10. When I try to build (and run) my program, C::B gives me the error:

cannot open output file bin\Debug\MultidimensionalArrays.exe Permission Denied

So, people have said to restart C::B - doesn't work; temporarily disable my antivirus (Avast) - doesn't work; delete the .exe file manually - doesn't work (says the file is open in System); go to Task Manager and kill the two (yes, two) MultidimensionalArrays.exe processes - doesn't work; download Process Explorer to kill process tree - doesn't work; do all of the above as an administrator - doesn't work.

(By the way, even when I didn't have this problem, I needed to disable Avast anyway, because when it was enabled I wasn't able to run my program.)

I've also tried restarting my computer, but alas, it doesn't work.

So...any suggestions? I want to get on with C++ but I have to deal with this annoying problem first.

P.S. If you want to look at my code for some reason:

#include <iostream>

using namespace std;

int main(){

    int chicken[2][4] = {{15, 25, 35, 45}, {16, 26, 27, 28}};

    for(int row = 0; row < 2; row ++){

        for(int column = 0; column < 4; column ++){
                cout << chicken[row][column] << " ";
        }

        cout << endl;

     }
}
1
I don't think this something that had to do with CB, seems that you don't have Permission to run the executable, try to see if the current user can read executables. Also you said is C++ and windowsm but you didn't say which compiler are you using, that could help a bit. - Joel
@Joel, I am using the mingw compiler that came with the version of C::B I downloaded. The user I am using has administrator powers, and as far as I know, I can read .exe files whenever I fancy. It's just in this strange (to me) situation where I don't have permission to touch the MultidimensionalArrays.exe file, be it with Windows Explorer or with Task Manager. - Nathan Flynn
make sure , using file explorer or whatever, that that exe file is actually gone . For good measure delete the entire bin directory, and make sure you run C::B as administrator - M.M
(In the long term it would be better to not run as admin for scurity reasons, but do it while you are debugging this problem) - M.M

1 Answers

-2
votes

I suppose codeblocks cannot open exe files.