While using the Dev C++ compiler for .cpp or .c that is c or c++ programming. Sometimes you may face problems and errors like "cannot open the output," "Permission denied," cannot open output file permission denied in dev c++, dev c++ failed to execute error 5: access denied, permission denied collect2.exe: error: ld returned 1 exit status, collect2.exe error dev c++, the system cannot find the file specified in dev c++, cannot open output file permission denied, build error in dev c++,  build error in c/c++, compiles but does not run, failed to execute the program or "path:collect2.exe returns error" during running your .C or CPP programming files. If you annoyed by these types of messages, then just apply any of the methods below. We will discuss the following topics given below.

    How to deal with Permission denied error in Dev c++

    After typing thousands of line of codes, debugging, a lot of thinking, and researching on google, when you try to run your code, suddenly a message pop-up Permission denied. Believe me, at that time you might get panic attack lol. But after a lot of searching on google. I found out three different ways to solve that error before going through the fix of that Permission denied error.  First of all, let's know Why this type of error occurs while running our codes. 

    Why Permission denied error occurs

    This problem generally occurs when we compile and run our program in dev c++ and do not close the output window .i.e the command prompt window. Due to which the .exe application is still running in the background. When you again try to run that program, the Permission denied error pop-up. We neither can modify that program, nor we can run it. We can use some steps to overcome the above Permission denied problem on Dev C++.

    Now moving on to solve the Permission denied, path:collect2.exe returns this type of error. You just need to follow the method below. I found three different solutions for errors. So first try to follow Close the already opened.exe application method if this doesn't work for you. Then try the Change the TDM-GCC and even if this not work for you. Then finally go with the last method, i.e. change the read-only option.

    Close the already opened .exe application

    Firstly close the running your_program_name.exe application of your program from the task manager

    Note: Here, .exe application in your case might be the name of your program; for example, it might be pascaltriangle.exe, matrix.exe, etc.

    You can do this by pressing ctrl + alt + del and select task manager. 

    Under Processes search for the your_program_name.exe.

    Right-click on your .exe programming file and select the end task.

    Now compile your program and run it. You will see your program will run perfectly without any error message.

    If the above method doesn't work for you, then try the following method.

    Change the TDM-GCC

    Open the Dev C++.

    Now from the below image, click on the yellow highlighted mark.


    And select the TDM-GCC 4.9.2 64bit Profiling if there is any other option is selected.

    Note: Select the Profiling option according to your system configuration. As my system is a 64-bit Operation system, that why I selected TDM-GCC 4.9.2 64bit Profiling.

     You can check your system configuration by clicking on start menu ⟹ search for system properties ⟹ click on system properties.

    Now, if you have a 32-bit operating system, then select the TDM-GCC 4.9.2 32bit Profiling.

    Watch the video below if you have any problem regarding this method.

    Done your Permission denied message will not be shown further in the future.

    Change the read-only option

    Go to the directory where your project files are stored

    Right-click on the folder where your programs are stored and select properties.

    And Uncheck the box read-only if it is checked and Then click on the apply button.

    If you find these methods and the most helpful, do share with friends who are facing this problem and follow and subscribe to our website spyronation so that you get more stuff like this, and you will get notified when we will post something. If you have any issues related to this post, please feel free to ask we will try to look into your problem. If you have any problem doing this method and not able to understand then comment below, we'll try to solve it.


    Post a Comment

    Previous Post Next Post