Topic: Cannot build previously working project - Totally flummoxed.

When I try to build a previously finely working project of earlier today, I get the following output and error message. The problem is, I have no idea what the problem is, and this output, while profuse and no doubt meaningful to someone else, does not help me. Looks all my routines compiled OK, but then sometime happened after that. What is going on? What permission is being denied, and permission to do what? What does "ld returned 1 exit status"?

==============================================================================
Generating Makefile... Okay
==============================================================================
Compiling ..\..\..\..\Fortran\Run_mswhip\auxx.f
Compiling ..\..\..\..\Fortran\Run_mswhip\matdiv.f
Compiling ..\..\..\..\Fortran\Run_mswhip\matmlt.f
Compiling ..\..\..\..\Fortran\Run_mswhip\mswhip.f
Compiling ..\..\..\..\Fortran\Run_mswhip\ncbktr.f
Compiling ..\..\..\..\Fortran\Run_mswhip\nceign.f
Compiling ..\..\..\..\Fortran\Run_mswhip\nchtd.f
Compiling ..\..\..\..\Fortran\Run_mswhip\ncorth.f
Compiling ..\..\..\..\Fortran\Run_mswhip\ncsep.f
Compiling ..\..\..\..\Fortran\Run_mswhip\nctdbs.f
Compiling ..\..\..\..\Fortran\Run_mswhip\nctrii.f
Compiling ..\..\..\..\Fortran\Run_mswhip\print1.f
Compiling ..\..\..\..\Fortran\Run_mswhip\rebak.f
Compiling ..\..\..\..\Fortran\Run_mswhip\reduc.f
Compiling ..\..\..\..\Fortran\Run_mswhip\rk.f
Compiling ..\..\..\..\Fortran\Run_mswhip\sturm.f
Generating target.exe
c:/program files (x86)/simply fortran 3/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot open output file target.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
Error: Last command making (target.exe) returned a bad status
Error: Deleting (target.exe): Permission denied
Error: Make execution terminated

* Failed *

Re: Cannot build previously working project - Totally flummoxed.

Look from the Windows task manager that there is not a "zombie process" of your project output executable already running that prevents linking the executable. Kill it off, if there is and try again.

Re: Cannot build previously working project - Totally flummoxed.

kbannister wrote:

c:/program files (x86)/simply fortran 3/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot open output file target.exe: Permission denied

The pertinent information is this part of the error.  Jali is correct, your program is most likely still running.  Look for target.exe in the Windows Task Manager and select "End Process" to stop it. 

There is also the possibility that a virus scanner is preventing the linker from writing an executable, but I feel as if that hasn't been a common problem for a few years now.

Jeff Armstrong
Approximatrix, LLC

4 (edited by kbannister 2024-03-21 15:52:18)

Re: Cannot build previously working project - Totally flummoxed.

OK many thanks. Will check it out! This exchange goes in my SF How-To notebook so I know what to do when the problem crops up again

I am so engrained in the "mainframe mentality" where, once your batch job
is done, you are done, you take your output and lumps, and no trace of your job in the CPU exists.