Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How do I create an OS-neutral run configuration in Eclipse?
How do I create an OS-neutral run configuration in Eclipse? [message #1007640] Wed, 06 February 2013 15:51 Go to next message
Neal Kruis is currently offline Neal Kruis
Messages: 15
Registered: October 2012
Junior Member
I would like to have a single run configuration that I can use whether I'm testing on a Windows system or a Unix system.

Everything seems to be fine with the exception that in the run configurations dialog the field for C/C++ Application requires the extension of the application as well.

So in Windows, it is: "Path/To/Application.exe"

and on a Unix system, it is: "Path/To/Application"

If there was someway to automatically detect the OS and apply the appropriate extension, I can share the same *.launch file with everyone working on the project regardless of their operating system.

I've looked a little bit into using Variables to set the path and file name, but most of them require additional dialogs and user inputs. Wild cards don't seem to work here either.

Any ideas?

BTW, This question is also on Stack Overflow if you'd like to answer it there instead-of/in-addition-to here:

Question number 14738096.

[Updated on: Wed, 06 February 2013 15:59]

Report message to a moderator

Re: How do I create an OS-neutral run configuration in Eclipse? [message #1007762 is a reply to message #1007640] Thu, 07 February 2013 07:37 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1949
Registered: July 2009
Senior Member
Did you try "Path/To/Application" on Windows? Usually you can start an executable w/o giving the extension.
Or you can create your own variable in Windows->Preferences->Run/Debug->String substitution. This variable will then be available in the Launch Config. These variables are defined for every workspace.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: How do I create an OS-neutral run configuration in Eclipse? [message #1007826 is a reply to message #1007762] Thu, 07 February 2013 11:28 Go to previous messageGo to next message
Neal Kruis is currently offline Neal Kruis
Messages: 15
Registered: October 2012
Junior Member
Thanks for your suggestions.

I've found that Windows does need an extension to find the executable.

The problem with using the string variables is that it still requires logic to determine which string to use. I would like for this to all be automated so developers don't have to go through too many extra steps to get started running/debugging the code.

[Updated on: Thu, 07 February 2013 11:32]

Report message to a moderator

Re: How do I create an OS-neutral run configuration in Eclipse? [message #1008079 is a reply to message #1007826] Fri, 08 February 2013 14:20 Go to previous message
Neal Kruis is currently offline Neal Kruis
Messages: 15
Registered: October 2012
Junior Member
Thanks to Marc K. for pointing out the quick fix of simply adding ".exe" extensions to the unix executables. Though, as he mentions, this isn't a perfect fix to the problem.
Previous Topic:eclipse creates exe for C++ not for C project
Next Topic:Eclipse CDT (for C++/C development) how to invoke content assist automatically while typing
Goto Forum:
  


Current Time: Tue Jul 29 00:51:58 EDT 2014

Powered by FUDForum. Page generated in 0.02175 seconds