From: Jawad Rehman on
Hi..

During Development of Prog,When i compile my prog,
Its works ok for the first time ,and executable is
created properly.

but on second time compilatin is Ok.
but on built of executable.compiler generates an error.

Linking...
LINK : fatal error LNK1168: cannot open Debug/Ex12.exe for writing
Error executing link.exe.

Ex12.exe - 1 error(s), 0 warning(s)


I did the following Measure ..

1).When I move the workSpace to some Other Drive,Its works ok for
some time.Then generate the same error again..

2)When I logout from computer and then login,compile the prog
and built executable,its works ok.but on second time,the Same
Error.....

3)I check out Read/write Permission.All my folders in computer is
Read only i dont know its why.
I remove The Read only Permission,But when i check, it becomes
again read only..

how to tackle it.

From: Bruno van Dooren [MVP VC++] on
> During Development of Prog,When i compile my prog,
> Its works ok for the first time ,and executable is
> created properly.
>
> but on second time compilatin is Ok.
> but on built of executable.compiler generates an error.
>
> Linking...
> LINK : fatal error LNK1168: cannot open Debug/Ex12.exe for writing
> Error executing link.exe.

This generally means that the program is still running. if an exe or DLL are
running, the linker cannot overwrite it.
Check if this is your problem.

--

Kind regards,
Bruno van Dooren
bruno_nos_pam_van_dooren(a)hotmail.com
Remove only "_nos_pam"


From: Scott McPhillips [MVP] on
Jawad Rehman wrote:
> Hi..
>
> During Development of Prog,When i compile my prog,
> Its works ok for the first time ,and executable is
> created properly.
>
> but on second time compilatin is Ok.
> but on built of executable.compiler generates an error.
>
> Linking...
> LINK : fatal error LNK1168: cannot open Debug/Ex12.exe for writing
> Error executing link.exe.

This means the program Ex12.exe is still running. A running program
cannot be deleted. So your program probably does not shut down
correctly, and when you build a new version it cannot be written over
the old exe file.

You can check to see if this is the problem by looking in Task Manager
after you close your program. Is it still there? If so there is
something wrong with the way your program exits.

--
Scott McPhillips [VC++ MVP]

From: Jean on
Jawad Rehman <jawadsmail(a)gmail.com> wrote:

> Hi..
>
> During Development of Prog,When i compile my prog,
> Its works ok for the first time ,and executable is
> created properly.
>
> but on second time compilatin is Ok.
> but on built of executable.compiler generates an error.
>
> Linking...
> LINK : fatal error LNK1168: cannot open Debug/Ex12.exe for writing
> Error executing link.exe.
>

Look on the task bar for a console app. or Ex12.exe (if it's GUI)
with a right click choose EXIT !