Skip to main content



      Home
Home » Newcomers » Newcomers » Automatically kill/terminate launched binary before compiling?
Automatically kill/terminate launched binary before compiling? [message #647201] Tue, 04 January 2011 19:37 Go to next message
Eclipse UserFriend
Hi,

Just wondering if there's a way to get eclipse to auto terminate an application before re-compiling?

If I forget to kill the app, I end up with an error like this:
" c:/qt/2010.02.1/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../ ../mingw32/bin/ld.exe: cannot open output file debug\CSV_Scrubber.exe: Permission denied
mingw32-make[1]: Leaving directory `C:/workspace/SVN/CSV Scrubber'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\CSV_Scrubber.exe] Error 1
mingw32-make: *** [debug] Error 2"

Then I have to kill the app and re-compile...

(I'm using eclipse w/ C++ & Qt, if this belongs in the cdt forum I'll head there but it seemed it might be an eclipse usage issue)

Thanks!

Matt
Re: Automatically kill/terminate launched binary before compiling? [message #647318 is a reply to message #647201] Wed, 05 January 2011 11:15 Go to previous messageGo to next message
Eclipse UserFriend
On 1/4/11 7:38 PM, bigarani.lists@gmail.com wrote:
> Hi,
>
> Just wondering if there's a way to get eclipse to auto terminate an
> application before re-compiling?
>
> If I forget to kill the app, I end up with an error like this:
> " c:/qt/2010.02.1/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../
> ../mingw32/bin/ld.exe: cannot open output file debug\CSV_Scrubber.exe:
> Permission denied
> mingw32-make[1]: Leaving directory `C:/workspace/SVN/CSV Scrubber'
> collect2: ld returned 1 exit status
> mingw32-make[1]: *** [debug\CSV_Scrubber.exe] Error 1
> mingw32-make: *** [debug] Error 2"
>
> Then I have to kill the app and re-compile...
>
> (I'm using eclipse w/ C++ & Qt, if this belongs in the cdt forum I'll
> head there but it seemed it might be an eclipse usage issue)

Did you see the "sticky" topic at the top of this forum group about
C/C++ questions? Try posting in the CDT forum group if you don't get
response here.

Eric
Re: Automatically kill/terminate launched binary before compiling? [message #647327 is a reply to message #647318] Wed, 05 January 2011 11:34 Go to previous message
Eclipse UserFriend
Yea I saw the sticky, I just didn't know if was a C/C++ specific issue.

CDT Post: http://www.eclipse.org/forums/index.php?t=msg&goto=64733 3&S=7825d3393bafcbed8f3c21ce4766dfa0#msg_647333

The solution I ended up with was to make a new builder that ran a batch file to terminate the application.

set sourceDir="%~p0"
set sourceDir=%sourceDir:\=;%
set sourceDir=%sourceDir: =:%

for /F "tokens=* delims=;" %%i IN (%sourceDir%) DO call :lastDir %%i
goto :EOF

:lastDir
if "%1"=="" (
  set dirName=%dirName::= %
  goto :terminate
)

set dirName=%1
SHIFT

goto :lastDir

:terminate

set "exeName=%dirName%.exe"
set exeName=%exeName: =_%
taskkill /F /IM "%exeName%"

Based on:
http://stackoverflow.com/questions/280969/windows-batch-loop -over-folder-string-and-parse-out-last-folder-name

One downside is that you have to put the script in each project directory.

[Updated on: Wed, 05 January 2011 11:50] by Moderator

Previous Topic:Make Eclipse project that runs either as RCP app or in IDE?
Next Topic:Problem Terminating Programmes
Goto Forum:
  


Current Time: Tue May 13 17:27:20 EDT 2025

Powered by FUDForum. Page generated in 0.08208 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top