News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

"Cannot open output file"

Started by lwe1389, June 17, 2014, 07:18:17 PM

Previous topic - Next topic

lwe1389

I know there are countless threads about this, though I assure you I've sifted through each of them and not found any answers to my problem.

Cannot open output file bin\debug\First Project.exe Permission Denied

I get this build error message ONLY after I've built once, (the first time always works) and then changed something. The next time I try to build I get that message.

is the message I'm getting. I've reinstalled codeblocks AND my moved my project folder multiple times, I've changed permissions, messed with user account controls, made Ld.exe in the codeblocks folder run as an administrator, checked in task manager and sysinternals for a double process of my code, etc.

None of these have worked, so if any of you have any ideas I'd love to hear them.

lwe1389

Update:

With task manager and sysinternals up, there are no conhost processes running when I am getting this error, there are also no "firstproject.exe" or whatever, BUT after about 5 minutes (5 long minutes) I am able to build again... It's acting as though it's taking a minute to close the process down but there is indeed none running.

Strange

Jenna

You did not really tell much about your installation.
I assume it is windows (exename and name of the tools).

This might be some stupid security software that kicks in and blocks the exe.

lwe1389



Quote from: jens on June 17, 2014, 08:21:47 PM
You did not really tell much about your installation.
I assume it is windows (exename and name of the tools).

This might be some stupid security software that kicks in and blocks the exe.

Windows 7 professional
64 bit


I've killed all antivirus and security exes in the task manager, and AVG is completely uninstalled (downloaded a clean AVG completely tool)

Still no luck.

BlueHazzard

probably a directory where you don't have write access? Try in your home directory...

lwe1389

#5
Update

It seems to work 75% of the time if I keep sysinternals process explorer up and directly kill the process each time before I hit any key to end


What a pain..

BlueHazzard

this is 300% a user problem... I have two things in mind:
1) Are you sure that you don't have any antivir, adaware, firewall or windows security installed what can block the access to your program?
2) Are you sure, that it is not a coding error, probably your application  crashes or hangs. (is there a drwat*.exe in the process tree?)

Quote from: lwe1389 on June 17, 2014, 11:14:38 PM
and directly kill the process each time before I hit any key to end
this screams for a coding error (deleting or not deleting a pointer...). Have you tried to debug your code?

greetings

lwe1389

It isn't a coding error, i'm following c + + primer, buckys tutorials, and a few other resources. A majority of the code is copy and paste or nearly identical to the sources aforementioned. It's day 3 of self learning and i'm only just starting to write my own (which obviously have mistakes at first) but the problem has persisted since the second I installed codeblocks. (if I change "hello world" to "hello Lance", it happens"

I'll look deeper into security software but I don't know if that's it


lwe1389


stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

pirx67

Well, I'll post a conjecture.

You can't write to the binary file of a program as long as the program is running, even as administrator. You've already suspected something like that.
I remember that one of the tools of the "Sysinternals Suite" could observe and log if a file has been opened by a process and if it is still open. Perhaps it is
the "Process Monitor". I don't remember exactly and I don't have a Windows System at hand now to check it.

Try to find out which process keeps your "First Example.exe" open and you should be one step towards a solution.

In spite of that turning on full compiler logging and posting the output should also do no harm  ;D

You may grab the "Sysinternals Suite" from here: http://technet.microsoft.com/en-us/sysinternals/bb842062.aspx

Lethamyr

You can Crtl+C your script and then, make a same project with the same title in the same file. That way, most of the times, you will get rid of your error and not erase the code, but sometimes, the code could be turned into the preview(code that is always made), so you would need to Ctrl+C it.
Please understand if my English is bad. I'm a Korean...