I am having a problem when i compile a program. What happens is that i would compile program, run it, see a problem, fix it, then try to compile it again and i get LINK : fatal error LNK1168: cannot open C:\Documents and Settings\Eric 22\Desktop\Exercises\celsFahr\Debug\celsFahr.exe(example file) for writing. I don't know why. The only way to fix it is to restart my computer and only compile and run it once until i have to restart it again. I am using Microsoft Visual C++ 2005 Express Edition. Is it the compiler or an other problem? Any answers?

Recommended Answers

All 5 Replies

That usually happens to me when I forget to close the output window for a debug run.

No but it is closed i even look with ctrl alt delete, it not running.

Use process explorer from www.sysinternals.com to search for the exe to see what other programs (say virus scanner) may have some kind of access to the file which is preventing you writing to it.

I don’t have much to say, b’cos most of the clues on why this happened has been already pointed out. But the main cause for this problem is when you run the code once and then try running it once again or compile or rebuilt it. You might have to make sure that the program has exited properly. Use the processor explores windows to check if the process is still running.

You might be doing something wrong in your code may be. See if you your program exits properly. Salems link for processor explore is a very good tools to check to make sure if there are any other process having of your code file etc.

On my research it seems that, this is a known issue which the VS team is already aware of. Got this information from the following link? But still make sure that by disabling all antivirus software and run it again.

http://connect.live.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=292259

You might find this link useful as well.

http://support.microsoft.com/kb/308358

ssharish

Thanks for the help! but it is still annoying closing the window.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.