Author Topic: can not open output file  (Read 253 times)

Offline mrwigglesworth

  • Single posting newcomer
  • *
  • Posts: 3
can not open output file
« on: June 04, 2018, 05:10:20 am »
Hello everyone.  I am rather new to programming.

I have been using learncpp.com to learn coding, and downloaded the code::blocks IDE.
Everything was going fine until I was learning to debug.  I was learning about the call stack and ran a code segment provided by the
site.  All was fine and dandy until I erased the code and attempted to run another segment.  I turned off the debugger and pasted the
new code and when I attempted to build I ran into an error.

In the build messages in the log window, under file it is 1d.exe, and the error associated was
 
cannot open output file bin\debug\testcode.exe  Permission denied
error: 1d returned 1 exit status.

In the build log it stated

C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot open output file bin\Debug\TestCode.exe: Permission denied
collect2.exe: error: ld returned 1 exit status


What did I do?

I can not even erase the file to begin again because it is stating a file is in use by another program

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10842
    • Travis build status
Re: can not open output file
« Reply #1 on: June 04, 2018, 08:57:36 am »
Open task manager and search for it or look for gdb.exe. When you find it, just kill the app and try to build again.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1849
Re: can not open output file
« Reply #2 on: June 04, 2018, 10:38:56 am »
What version of codeblocks are you using?
Try a nightly if this error keeps popping up...

Offline mrwigglesworth

  • Single posting newcomer
  • *
  • Posts: 3
Re: can not open output file
« Reply #3 on: June 13, 2018, 02:00:54 pm »
@oBFusCATed

thank you, that did the trick.  I lost that one project because I missed your reply.  I ran into the same issue with another debugging and
your suggestion resolved the issue.  Thank you for your time.

@BlueHazzard
17.12
Thank you for helping.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10842
    • Travis build status
Re: can not open output file
« Reply #4 on: June 13, 2018, 05:36:30 pm »
Can you try to find a way to reproduce the problem reliably?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]