Skip to main content



      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
Eclipse UserFriend
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] by 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
Eclipse UserFriend
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.
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
Eclipse UserFriend
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] by 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
Eclipse UserFriend
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: Wed Jul 23 08:22:25 EDT 2025

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

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

Back to the top