Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » how to run an executable
how to run an executable [message #175787] Fri, 01 September 2006 00:17 Go to next message
Eclipse UserFriend
Originally posted by: msuhk45.gmail.com

Hello!
I'm running Eclipse 3.2.0 with CDT (the latest one) on windows xp with the
(djgpp) version of g++ (the file was perviously named gpp.exe, which I had
to rename to g++.exe to make it work with eclipse) and gcc
http://www.delorie.com/djgpp/

When I compile a source file in a managed make C++ project, I get a *.exe
file in the "Rlease" directory, which is in the project directory.

When I right-click on the project folder and chose "Run as -> run/local
C++..." I get the following error message:

"Launch failed no binaries"

I have to double-click the *.exe file to execute it, but it quits when it
ends so I can't see the results (such as when writing simple "hellow world"
programs)
Fortunately, I figured out a way to capture the output using this way of
execution by adding an input prompt at the end, but does anyone know of
easier way of executing *.exe's? (such as in a built-in console or
something)

PS g++ takes a relatively long time to compile code if envoked through
Eclipse. (I know it's faster from the command line only "g++ foo.cpp")
Eclipse seems to add a lot of parameters to g++ and requires "make" to
compile, which makes the compile time considerably longer...
Can I compile code faster? (also without using make?)

Regards
Re: how to run an executable [message #175867 is a reply to message #175787] Fri, 01 September 2006 10:10 Go to previous messageGo to next message
Eclipse UserFriend
Hi mus,

have you tried ...

1) Right-click on the ready-build *.exe
2) What looks the icon for your ready-build *.exe like? If CDT has noted
that it is an executable then it looks like a little running man. If this is
not the case then the CDT has not been able to discover that it is an
executable and consequently will refuse to launch it.

Check the "Binary Parser" setting on your project. This may be an issue with
the details of the binary format of your compiler when I come to think of
it. Try the Windows PE and Cygwin Windows PE parsers alternatively.

3) You could try configuring the launch explicitly with the launch
configuration dialog. There is online help for this (in the help browser see
C/C++ Development User Guide -> Tasks -> Running and debugging projects)

> Can I compile code faster? (also without using make?)

Yes, you can create a standard make project, open the make targets view and
add a make target in your project folder. Change the setting for the make
command (from make -f) to g++ foo.c

This will not invoke make; it will directly invoke the compiler.

Greetings,



Norbert
Re: how to run an executable [message #175911 is a reply to message #175867] Fri, 01 September 2006 14:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: msuhk45.gmail.com

Thanks very much for your help!

The *.exe files compiled with DJGPP looked like regular files (no running
man icon)
I installed Cygwin's g++ and it worked! (the man is appearing now) Now I
can launch compiled console programs from Eclipse and they appear in the
Eclipse console :)

The Cygwin g++ works faster than DJGPP's one, so I'm ok with running make
now.

However, I'd like to have the *.exe files named the same as the *.cpp files,
such as foo.exe for foo.cpp. Can I do that?

Regards,
Mus
Re: how to run an executable [message #176007 is a reply to message #175911] Mon, 04 September 2006 04:11 Go to previous message
Eclipse UserFriend
Originally posted by: norbert.ploett.fen-net.de

mus

> However, I'd like to have the *.exe files named the same as the *.cpp
> files,
> such as foo.exe for foo.cpp. Can I do that?

now, how are you building? If you are running your own makefile you must
change the makefile.
If you are the approach I described with the make targets view then you must
add a -o foo.exe to the build command.
For managed make, go to the project properties and change the C/C++ Build ->
Build Settings -> Artifact name

Regards,


Norbert
Previous Topic:Indexer source
Next Topic:monitoring focus change for a view
Goto Forum:
  


Current Time: Tue Jul 15 05:18:38 EDT 2025

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

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

Back to the top