Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How to run another application from Eclipse CDT application(How to run applicatio from Eclipse CDT)
icon8.gif  How to run another application from Eclipse CDT application [message #1750290] Mon, 19 December 2016 15:56 Go to next message
Joyita Das is currently offline Joyita DasFriend
Messages: 4
Registered: November 2016
Junior Member
Hi,

I am trying to run an application developed in another IDE, from the application developed in Eclipse CDT. Both of them are developed in C++ and Windows 7 OS. I am very new and dont know to work with Eclipse.

Can someone tell me if I can call the compiled exe file from my Eclipse C++ application or do I need to use command line through my Eclipse c++ application to call the application written in the other IDE.

Please help! Please provide the code for doing the same or point me in the right direction.

Thanks.

[Updated on: Mon, 19 December 2016 15:59]

Report message to a moderator

Re: How to run another application from Eclipse CDT application [message #1750305 is a reply to message #1750290] Mon, 19 December 2016 18:32 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
You can launch any executable for debugging or simply running by creating a run/debug configuration.
http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Ftasks%2Fcdt_o_run.htm&cp=8_3_5

Somewhat confusing is that there is really only one kind of launch configuration used for both debug launching or program running. What panels are available depends on how you edit it . For example, the debug panels only show if you are editing it as a debug configuration.

Be aware there is a typo on the page titled "Selecting a run or debug configuration".
You get to this dialog by selecting Run --> Run Configurations ... or Run -> Debug Configurations ... instead of Run -> Run or Run -> Debug. The latter actually launch the last chosen configuration.

There are icons in the Launch toolbar along with drop-down menus which can also be used.

You can also run a program as an external tool.
http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-exttools-running.htm

EDIT:
It's occurred to me that you may be asking how to use your executable to run another program. If so, it has nothing to do with CDT,. Look up how to do this in windows. Here's one link: http://stackoverflow.com/questions/17703721/how-to-execute-another-exe-from-a-c-program-in-windows

[Updated on: Mon, 19 December 2016 19:52]

Report message to a moderator

Re: How to run another application from Eclipse CDT application [message #1750312 is a reply to message #1750290] Mon, 19 December 2016 19:52 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
For running another executable program from C/C++ code, there is a library function in the C library:

int system(const char *shellcommand)

which calls the command interpreter of the operating system and sends the argument string as the command line to it.


--

Tauno Voipio
Re: How to run another application from Eclipse CDT application [message #1750315 is a reply to message #1750312] Mon, 19 December 2016 20:05 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
I see there was a cross-post.

The system function is the simplest but has some security and flexibility issues.
Microsoft also has CreateProcess and a couple of others which are more flexible.
It's documented in the Microsoft Developer Network library:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx

[Updated on: Mon, 19 December 2016 20:06]

Report message to a moderator

Previous Topic:My title - a not very intelligent newbie.
Next Topic:Technical error
Goto Forum:
  


Current Time: Tue Mar 19 03:11:51 GMT 2024

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

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

Back to the top